diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 4ff0200f..15465a3e 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3078,6 +3078,7 @@ Python: - .pyt - .pyw - .rpy + - .spec - .tac - .wsgi - .xpy @@ -3340,6 +3341,7 @@ Ruby: - .rbx - .ru - .ruby + - .spec - .thor - .watchr interpreters: diff --git a/samples/Python/spec.linux.spec b/samples/Python/spec.linux.spec new file mode 100644 index 00000000..c5806cd3 --- /dev/null +++ b/samples/Python/spec.linux.spec @@ -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') diff --git a/samples/Ruby/any.spec b/samples/Ruby/any.spec new file mode 100644 index 00000000..50188314 --- /dev/null +++ b/samples/Ruby/any.spec @@ -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