mactag 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +64 -50
- data/bin/mactag +95 -0
- data/lib/mactag.rb +26 -4
- data/lib/mactag/builder.rb +1 -1
- data/lib/mactag/bundler.rb +9 -1
- data/lib/mactag/config.rb +51 -39
- data/lib/mactag/ctags.rb +1 -1
- data/lib/mactag/dsl.rb +62 -14
- data/lib/mactag/indexer.rb +1 -0
- data/lib/mactag/indexer/lib.rb +22 -0
- data/lib/mactag/indexer/rails.rb +7 -6
- data/spec/mactag/config_spec.rb +57 -10
- data/spec/mactag/ctags_spec.rb +2 -1
- data/spec/mactag/dsl_spec.rb +50 -0
- data/spec/mactag/indexer/lib_spec.rb +20 -0
- data/spec/mactag/indexer/rails_spec.rb +6 -6
- data/spec/mactag_spec.rb +15 -0
- data/spec/matcher.rb +8 -0
- data/spec/matcher/app.rb +32 -0
- data/spec/matcher/gem.rb +39 -0
- data/spec/matcher/lib.rb +31 -0
- data/spec/matcher/plugin.rb +32 -0
- data/spec/matcher/rails.rb +49 -0
- data/spec/spec_helper.rb +0 -2
- metadata +38 -27
- data/lib/generators/mactag/mactag_generator.rb +0 -11
- data/lib/generators/mactag/templates/mactag.rb +0 -39
- data/lib/tasks/mactag.rake +0 -8
@@ -0,0 +1,49 @@
|
|
1
|
+
module Matcher
|
2
|
+
class RailsIndex
|
3
|
+
def initialize(*args)
|
4
|
+
if args.last.is_a?(Hash)
|
5
|
+
@version = args.last[:version]
|
6
|
+
|
7
|
+
args.pop
|
8
|
+
end
|
9
|
+
|
10
|
+
@packages = args
|
11
|
+
end
|
12
|
+
|
13
|
+
def matches?(dsl)
|
14
|
+
@actual = dsl.builder.tags.first
|
15
|
+
|
16
|
+
same_packages? && same_version? && rails_indexer?
|
17
|
+
end
|
18
|
+
|
19
|
+
def failure_message
|
20
|
+
"expected '#{@actual.inspect}' to equal '#{@packages}/#{@version}' but did not"
|
21
|
+
end
|
22
|
+
|
23
|
+
def negative_failure_message
|
24
|
+
"expected '#{@actual.inspect}' to not equal '#{@packages}/#{@version}' but did"
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def same_version?
|
30
|
+
if @version
|
31
|
+
@actual.version == @version
|
32
|
+
else
|
33
|
+
true
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def same_packages?
|
38
|
+
@actual.packages - @packages == @packages - @actual.packages
|
39
|
+
end
|
40
|
+
|
41
|
+
def rails_indexer?
|
42
|
+
@actual.is_a?(Mactag::Indexer::Rails)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def have_rails_index(*args)
|
47
|
+
RailsIndex.new(*args)
|
48
|
+
end
|
49
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mactag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 7
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.7.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Johan Andersson
|
@@ -18,38 +18,36 @@ cert_chain: []
|
|
18
18
|
date: 2011-02-06 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
name:
|
21
|
+
name: rspec
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 13
|
29
29
|
segments:
|
30
|
-
-
|
31
|
-
-
|
32
|
-
|
33
|
-
|
34
|
-
type: :runtime
|
30
|
+
- 2
|
31
|
+
- 7
|
32
|
+
version: "2.7"
|
33
|
+
type: :development
|
35
34
|
version_requirements: *id001
|
36
35
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
36
|
+
name: yard
|
38
37
|
prerelease: false
|
39
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
41
40
|
requirements:
|
42
|
-
- -
|
41
|
+
- - ">="
|
43
42
|
- !ruby/object:Gem::Version
|
44
|
-
hash:
|
43
|
+
hash: 3
|
45
44
|
segments:
|
46
|
-
-
|
47
|
-
|
48
|
-
version: "2.7"
|
45
|
+
- 0
|
46
|
+
version: "0"
|
49
47
|
type: :development
|
50
48
|
version_requirements: *id002
|
51
49
|
- !ruby/object:Gem::Dependency
|
52
|
-
name:
|
50
|
+
name: redcarpet
|
53
51
|
prerelease: false
|
54
52
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
53
|
none: false
|
@@ -63,7 +61,7 @@ dependencies:
|
|
63
61
|
type: :development
|
64
62
|
version_requirements: *id003
|
65
63
|
- !ruby/object:Gem::Dependency
|
66
|
-
name:
|
64
|
+
name: rake
|
67
65
|
prerelease: false
|
68
66
|
requirement: &id004 !ruby/object:Gem::Requirement
|
69
67
|
none: false
|
@@ -76,10 +74,10 @@ dependencies:
|
|
76
74
|
version: "0"
|
77
75
|
type: :development
|
78
76
|
version_requirements: *id004
|
79
|
-
description: Mactag is a Ctags
|
77
|
+
description: Mactag is a DSL to create Ctags files for Ruby/Rails
|
80
78
|
email: johan.rejeep@gmail.com
|
81
|
-
executables:
|
82
|
-
|
79
|
+
executables:
|
80
|
+
- mactag
|
83
81
|
extensions: []
|
84
82
|
|
85
83
|
extra_rdoc_files:
|
@@ -88,8 +86,6 @@ files:
|
|
88
86
|
- README.markdown
|
89
87
|
- Rakefile
|
90
88
|
- VERSION
|
91
|
-
- lib/generators/mactag/mactag_generator.rb
|
92
|
-
- lib/generators/mactag/templates/mactag.rb
|
93
89
|
- lib/mactag.rb
|
94
90
|
- lib/mactag/builder.rb
|
95
91
|
- lib/mactag/bundler.rb
|
@@ -103,7 +99,7 @@ files:
|
|
103
99
|
- lib/mactag/indexer/gem.rb
|
104
100
|
- lib/mactag/indexer/plugin.rb
|
105
101
|
- lib/mactag/indexer/rails.rb
|
106
|
-
- lib/
|
102
|
+
- lib/mactag/indexer/lib.rb
|
107
103
|
- spec/mactag/builder_spec.rb
|
108
104
|
- spec/mactag/bundler_spec.rb
|
109
105
|
- spec/mactag/config_spec.rb
|
@@ -111,10 +107,18 @@ files:
|
|
111
107
|
- spec/mactag/dsl_spec.rb
|
112
108
|
- spec/mactag/indexer/app_spec.rb
|
113
109
|
- spec/mactag/indexer/gem_spec.rb
|
110
|
+
- spec/mactag/indexer/lib_spec.rb
|
114
111
|
- spec/mactag/indexer/plugin_spec.rb
|
115
112
|
- spec/mactag/indexer/rails_spec.rb
|
116
113
|
- spec/mactag_spec.rb
|
114
|
+
- spec/matcher/app.rb
|
115
|
+
- spec/matcher/gem.rb
|
116
|
+
- spec/matcher/lib.rb
|
117
|
+
- spec/matcher/plugin.rb
|
118
|
+
- spec/matcher/rails.rb
|
119
|
+
- spec/matcher.rb
|
117
120
|
- spec/spec_helper.rb
|
121
|
+
- bin/mactag
|
118
122
|
homepage: http://github.com/rejeep/mactag
|
119
123
|
licenses: []
|
120
124
|
|
@@ -144,10 +148,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
148
|
requirements: []
|
145
149
|
|
146
150
|
rubyforge_project:
|
147
|
-
rubygems_version: 1.8.
|
151
|
+
rubygems_version: 1.8.15
|
148
152
|
signing_key:
|
149
153
|
specification_version: 3
|
150
|
-
summary: Ctags for Rails
|
154
|
+
summary: Ctags for Ruby/Rails
|
151
155
|
test_files:
|
152
156
|
- spec/mactag/builder_spec.rb
|
153
157
|
- spec/mactag/bundler_spec.rb
|
@@ -156,8 +160,15 @@ test_files:
|
|
156
160
|
- spec/mactag/dsl_spec.rb
|
157
161
|
- spec/mactag/indexer/app_spec.rb
|
158
162
|
- spec/mactag/indexer/gem_spec.rb
|
163
|
+
- spec/mactag/indexer/lib_spec.rb
|
159
164
|
- spec/mactag/indexer/plugin_spec.rb
|
160
165
|
- spec/mactag/indexer/rails_spec.rb
|
161
166
|
- spec/mactag_spec.rb
|
167
|
+
- spec/matcher/app.rb
|
168
|
+
- spec/matcher/gem.rb
|
169
|
+
- spec/matcher/lib.rb
|
170
|
+
- spec/matcher/plugin.rb
|
171
|
+
- spec/matcher/rails.rb
|
172
|
+
- spec/matcher.rb
|
162
173
|
- spec/spec_helper.rb
|
163
174
|
has_rdoc:
|
@@ -1,39 +0,0 @@
|
|
1
|
-
Mactag.configure do |config|
|
2
|
-
# Use RVM to locate project gems.
|
3
|
-
# config.rvm = false
|
4
|
-
|
5
|
-
# Path to gems. No need to set this when RVM is used!
|
6
|
-
# config.gem_home = '/Library/Ruby/Gems/1.8/gems'
|
7
|
-
|
8
|
-
# Name of tags file to create.
|
9
|
-
# config.tags_file = '.tags'
|
10
|
-
|
11
|
-
# Command used to create the tags table. {INPUT} and {OUTPUT} are required!
|
12
|
-
# config.binary = '/usr/local/Cellar/ctags/5.8/bin/ctags -e -o {OUTPUT} {INPUT}'
|
13
|
-
end
|
14
|
-
|
15
|
-
Mactag do
|
16
|
-
# Index current project.
|
17
|
-
# index :app
|
18
|
-
|
19
|
-
# Index all models and helpers.
|
20
|
-
# index 'app/models/*.rb', 'app/helpers/*.rb'
|
21
|
-
|
22
|
-
# Index the gems carrierwave and redcarpet.
|
23
|
-
# index 'carrierwave', 'redcarpet'
|
24
|
-
|
25
|
-
# Index the gem simple_form version 1.5.2.
|
26
|
-
# index 'simple_form', :version => '1.5.2'
|
27
|
-
|
28
|
-
# Index rails.
|
29
|
-
# index :rails
|
30
|
-
|
31
|
-
# Index rails except action mailer.
|
32
|
-
# index :rails, :except => :actionmailer
|
33
|
-
|
34
|
-
# Index only rails packages activerecord and activesupport.
|
35
|
-
# index :rails, :only => %w(activerecord activesupport)
|
36
|
-
|
37
|
-
# Index rails, version 3.1.3.
|
38
|
-
# index :rails, :version => '3.1.3'
|
39
|
-
end
|