mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 01:30:22 +00:00
Add .spec as a supported Python and Ruby extension
This commit is contained in:
@@ -3078,6 +3078,7 @@ Python:
|
||||
- .pyt
|
||||
- .pyw
|
||||
- .rpy
|
||||
- .spec
|
||||
- .tac
|
||||
- .wsgi
|
||||
- .xpy
|
||||
@@ -3340,6 +3341,7 @@ Ruby:
|
||||
- .rbx
|
||||
- .ru
|
||||
- .ruby
|
||||
- .spec
|
||||
- .thor
|
||||
- .watchr
|
||||
interpreters:
|
||||
|
||||
22
samples/Python/spec.linux.spec
Normal file
22
samples/Python/spec.linux.spec
Normal file
@@ -0,0 +1,22 @@
|
||||
a = Analysis(['portablizer.pyqt4.py'],
|
||||
hiddenimports=[],
|
||||
hookspath=None,
|
||||
runtime_hooks=None)
|
||||
pyz = PYZ(a.pure)
|
||||
exe = EXE(pyz,
|
||||
a.scripts,
|
||||
exclude_binaries=True,
|
||||
name='Portablizer',
|
||||
debug=False,
|
||||
strip=None,
|
||||
upx=True,
|
||||
console=False)
|
||||
node = Tree('node', prefix='node')
|
||||
collect = COLLECT(exe,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
node,
|
||||
strip=None,
|
||||
upx=True,
|
||||
name='Portablizer')
|
||||
44
samples/Ruby/any.spec
Normal file
44
samples/Ruby/any.spec
Normal file
@@ -0,0 +1,44 @@
|
||||
require File.dirname(File.expand_path(__FILE__)) + '/../spec_helper'
|
||||
|
||||
describe Spira::Types::Any do
|
||||
|
||||
before :all do
|
||||
@uri = RDF::URI('http://example.org')
|
||||
end
|
||||
|
||||
# this spec is going to be necessarily loose. The 'Any' type is defined to
|
||||
# use RDF.rb's automatic RDF Literal boxing and unboxing, which may or may
|
||||
# not change between verions.
|
||||
#
|
||||
context "when serializing" do
|
||||
it "should serialize literals to RDF Literals" do
|
||||
serialized = Spira::Types::Any.serialize(15)
|
||||
serialized.should be_a RDF::Literal
|
||||
serialized = Spira::Types::Any.serialize("test")
|
||||
serialized.should be_a RDF::Literal
|
||||
end
|
||||
|
||||
it "should keep RDF::URIs as URIs" do
|
||||
Spira::Types::Any.serialize(@uri).should == @uri
|
||||
end
|
||||
|
||||
it "should fail to serialize collections" do
|
||||
lambda { Spira::Types::Any.serialize([]) }.should raise_error TypeError
|
||||
end
|
||||
end
|
||||
|
||||
context "when unserializing" do
|
||||
it "should unserialize to ruby types" do
|
||||
value = Spira::Types::Any.unserialize(RDF::Literal.new(5, :datatype => RDF::XSD.integer))
|
||||
value.should == 5
|
||||
value = Spira::Types::Any.unserialize(RDF::Literal.new("a string"))
|
||||
value.should == "a string"
|
||||
end
|
||||
|
||||
it "should unserialize URIs to URIs" do
|
||||
Spira::Types::Any.unserialize(@uri).should == @uri
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user