textpow 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,67 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Textpow do
4
- before do
5
- Textpow.send(:class_variable_set, "@@syntax", {})
6
- end
7
-
8
- it "has a version" do
9
- Textpow::Version =~ /^\d\.\d\.\d$/
10
- end
11
-
12
- it "has syntax files named after their scopeName" do
13
- Dir["#{Textpow.syntax_path}/*"].each do |file|
14
- next if File.directory?(file)
15
- (YAML.load_file(file)['scopeName'] + '.syntax').should == File.basename(file)
16
- end
17
- end
18
-
19
- describe "syntax" do
20
- it "finds syntax by path" do
21
- Textpow.syntax('lib/textpow/syntax/source.ruby.syntax').name.should == 'Ruby'
22
- end
23
-
24
- it "finds syntax by path with capital letters" do
25
- Textpow.syntax('spec/fixtures/objeck.tmSyntax').class.should == Textpow::SyntaxNode
26
- end
27
-
28
- it "complains about unreadable files" do
29
- expect{
30
- Textpow.syntax('Rakefile')
31
- }.to raise_error(/Could not parse file Rakefile/)
32
- end
33
-
34
- it "finds a syntax by scopeName" do
35
- Textpow.syntax('source.ruby').name.should == 'Ruby'
36
- end
37
-
38
- it "caches found syntax" do
39
- Textpow.syntax('ruby').name.should == 'Ruby'
40
- Dir.should_not_receive(:glob)
41
- Textpow.syntax('ruby').name.should == 'Ruby'
42
- end
43
-
44
- it "finds a syntax by name parts" do
45
- Textpow.syntax('ruby').name.should == 'Ruby'
46
- end
47
-
48
- it "returns the found syntax for mixed case" do
49
- Textpow.syntax('RuBy').name.should == 'Ruby'
50
- end
51
-
52
- it "returns nil for unfound syntax" do
53
- Textpow.syntax('buby').should == nil
54
- end
55
-
56
- it "does not find directories" do
57
- Textpow.syntax('lib').should == nil
58
- end
59
-
60
- it "caches nil for unfound syntax" do
61
- Dir.should_receive(:glob).and_return []
62
- Textpow.syntax('buby').should == nil
63
- Dir.should_not_receive(:glob)
64
- Textpow.syntax('buby').should == nil
65
- end
66
- end
67
- end
@@ -1,18 +0,0 @@
1
- $LOAD_PATH.push File.expand_path("../lib", __FILE__)
2
- name = "textpow"
3
- require "#{name}/version"
4
-
5
- Gem::Specification.new name, Textpow::Version do |s|
6
- s.authors = ["Dizan Vasquez", "Spox", "Chris Hoffman", "Michael Grosser"]
7
- s.email = ["michael@grosser.it"]
8
- s.homepage = "https://github.com/grosser/#{name}"
9
- s.summary = "A library for parsing TextMate bundles"
10
- s.description = s.summary
11
- s.license = "MIT"
12
-
13
- s.files = `git ls-files`.split("\n")
14
- s.executables = ["plist2yaml", "plist2syntax"]
15
- s.rdoc_options = ["--main", "README.rdoc"]
16
-
17
- s.add_runtime_dependency "plist", '>=3.0.1'
18
- end