jpi 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,4 +1,6 @@
1
1
  require 'bundler'
2
+ require 'cucumber/rake/task'
3
+
2
4
  class Bundler::GemHelper
3
5
  def version_tag
4
6
  "jpi-v#{version}"
@@ -6,6 +8,14 @@ class Bundler::GemHelper
6
8
  install_tasks
7
9
  end
8
10
 
9
- require 'rspec/core/rake_task'
10
- RSpec::Core::RakeTask.new(:spec)
11
+ namespace :cucumber do
12
+ Cucumber::Rake::Task.new(:ok, 'Run features that are being worked on') do |t|
13
+ t.cucumber_opts = "--tags ~@wip"
14
+ end
15
+ Cucumber::Rake::Task.new(:wip, 'Run features that are being worked on') do |t|
16
+ t.cucumber_opts = "--tags @wip"
17
+ end
18
+ end
11
19
 
20
+ desc 'Alias for cucumber:ok'
21
+ task :cucumber => "cucumber:ok"
@@ -1,4 +1,3 @@
1
-
2
1
  Feature: Generating a new Jenkins Ruby Plugin
3
2
 
4
3
  Creating a new Ruby plugin for Jenkins needs to be as simple as running a single command
@@ -6,13 +5,10 @@ that will generate a project skeleton. This skeleton will come complete with git
6
5
  the goodies that you need to do your plugin develompent.
7
6
 
8
7
  Scenario: The directory skeleton is generated
9
- When I run "jpi new newplugin"
10
- # Then I should see this structure
11
- # """
12
- # [-] newplugin
13
- # | [+] .git
14
- # | .gitignore
15
- # | Gemfile
16
- # | Rakefile
17
- # | newplugin.pluginspec
18
- # """
8
+ When I run `jpi new cuke`
9
+ Then I should see this structure
10
+ """
11
+ [-] cuke-plugin
12
+ | Gemfile
13
+ | cuke.pluginspec
14
+ """
@@ -1,7 +1,3 @@
1
- When /^I run "([^"]*)"$/ do |cmd|
2
- run cmd
3
- end
4
-
5
1
  Then /^I should see this structure$/ do |structure|
6
2
  fail "no match" unless DirectoryStructure.new(structure).matches? work_dir
7
- end
3
+ end
@@ -1,24 +1,25 @@
1
1
 
2
2
  class DirectoryStructure
3
3
  def initialize(structure)
4
-
5
- @root = context = DirChild.new('.')
4
+ context = DirChild.new('.')
6
5
 
7
6
  structure.each_line do |line|
8
- if line =~ /(\[[-+]\]|\|)?\s+(\.?\w+)$/
7
+ if line =~ /^(\[\-+\]|\ \|\ )\s+(.+)$/
9
8
  op, name = $1, $2
10
- case op
11
- when "[+]"
12
- context.add(DirChild.new name)
13
- when "[-]"
14
- new_context = DirChild.new name
15
- context.add(new_context)
16
- context = new_context
17
- when "|"
18
- context.add(FileChild.new name)
19
- end
9
+ child = case op
10
+ when "[+]"
11
+ DirChild.new name
12
+ when "[-]"
13
+ # TODO: make to tree structure
14
+ DirChild.new name
15
+ when " | "
16
+ FileChild.new name
17
+ end
18
+ context.add child
20
19
  end
21
20
  end
21
+
22
+ @root = context
22
23
  end
23
24
 
24
25
  def matches?(dir)
@@ -28,22 +29,23 @@ class DirectoryStructure
28
29
  Entry = Struct.new(:name)
29
30
 
30
31
  class DirChild < Entry
32
+ attr_accessor :entries
33
+
31
34
  def initialize(name)
32
35
  super(name)
33
36
  @entries = []
34
37
  end
35
38
 
36
39
  def add(entry)
37
- @entries << entries
40
+ @entries << entry
38
41
  end
39
42
 
40
43
  def matches?(realdir)
41
- entries = Dir.new(realdir).entries
42
- !@entries.detect {|e| !entries.map{|e| File.basename(e)}.member?(e)}
44
+ real_entries = Dir.glob(realdir + '/**/*').map{|e| File.basename(e) }
45
+ (@entries.map(&:name) <=> real_entries) < 1
43
46
  end
44
47
  end
45
48
 
46
49
  class FileChild < Entry
47
-
48
50
  end
49
- end
51
+ end
@@ -0,0 +1 @@
1
+ require 'aruba/cucumber'
@@ -0,0 +1,13 @@
1
+ module Work
2
+ def work_dir
3
+ @work_dir ||= File.expand_path("tmp/work")
4
+ end
5
+ end
6
+
7
+ World(Work)
8
+
9
+ Before do
10
+ FileUtils.rm_rf work_dir
11
+ FileUtils.mkdir_p work_dir
12
+ @dirs = [work_dir]
13
+ end
data/jpi.gemspec CHANGED
@@ -17,13 +17,13 @@ Gem::Specification.new do |s|
17
17
  s.executables = ['jpi']
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_dependency "rubyzip"
20
+ s.add_dependency "bundler"
21
21
  s.add_dependency "thor"
22
- s.add_dependency "jenkins-war", ">= 1.427"
23
- s.add_dependency "bundler", "~> 1.1.0"
22
+ s.add_dependency "rubyzip"
23
+ s.add_dependency "jenkins-war", "> 1.427"
24
24
  s.add_dependency "jenkins-plugin-runtime", "~> #{Jenkins::Plugin::RUNTIME_VERSION_DEPENDENCY}"
25
25
 
26
- s.add_development_dependency "rspec", "~> 2.0"
27
- s.add_development_dependency "cucumber", "~> 1.0"
28
26
  s.add_development_dependency "rake"
27
+ s.add_development_dependency "cucumber"
28
+ s.add_development_dependency "aruba"
29
29
  end
@@ -1,6 +1,6 @@
1
1
  module Jenkins
2
2
  class Plugin
3
- VERSION = "0.3.7"
4
- RUNTIME_VERSION_DEPENDENCY = "0.2.0"
3
+ VERSION = "0.3.8"
4
+ RUNTIME_VERSION_DEPENDENCY = "0.2.3"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,178 +1,230 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: jpi
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.3.7
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.8
5
+ prerelease:
6
6
  platform: ruby
7
- authors:
8
- - Charles Lowell
9
- - "J\xC3\xB8rgen P. Tjern\xC3\xB8"
10
- - Kohsuke Kawaguchi
11
- autorequire:
7
+ authors:
8
+ - Charles Lowell
9
+ - Jørgen P. Tjernø
10
+ - Kohsuke Kawaguchi
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
-
15
- date: 2012-04-25 00:00:00 Z
16
- dependencies:
17
- - !ruby/object:Gem::Dependency
18
- name: rubyzip
19
- prerelease: false
20
- requirement: &id001 !ruby/object:Gem::Requirement
21
- none: false
22
- requirements:
23
- - - ">="
24
- - !ruby/object:Gem::Version
25
- version: "0"
26
- type: :runtime
27
- version_requirements: *id001
28
- - !ruby/object:Gem::Dependency
29
- name: thor
30
- prerelease: false
31
- requirement: &id002 !ruby/object:Gem::Requirement
32
- none: false
33
- requirements:
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: "0"
37
- type: :runtime
38
- version_requirements: *id002
39
- - !ruby/object:Gem::Dependency
40
- name: jenkins-war
41
- prerelease: false
42
- requirement: &id003 !ruby/object:Gem::Requirement
43
- none: false
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: "1.427"
48
- type: :runtime
49
- version_requirements: *id003
50
- - !ruby/object:Gem::Dependency
51
- name: bundler
52
- prerelease: false
53
- requirement: &id004 !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
56
- - - ~>
57
- - !ruby/object:Gem::Version
58
- version: 1.1.0
59
- type: :runtime
60
- version_requirements: *id004
61
- - !ruby/object:Gem::Dependency
62
- name: jenkins-plugin-runtime
63
- prerelease: false
64
- requirement: &id005 !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ~>
68
- - !ruby/object:Gem::Version
69
- version: 0.2.0
70
- type: :runtime
71
- version_requirements: *id005
72
- - !ruby/object:Gem::Dependency
73
- name: rspec
74
- prerelease: false
75
- requirement: &id006 !ruby/object:Gem::Requirement
76
- none: false
77
- requirements:
78
- - - ~>
79
- - !ruby/object:Gem::Version
80
- version: "2.0"
81
- type: :development
82
- version_requirements: *id006
83
- - !ruby/object:Gem::Dependency
84
- name: cucumber
85
- prerelease: false
86
- requirement: &id007 !ruby/object:Gem::Requirement
87
- none: false
88
- requirements:
89
- - - ~>
90
- - !ruby/object:Gem::Version
91
- version: "1.0"
92
- type: :development
93
- version_requirements: *id007
94
- - !ruby/object:Gem::Dependency
95
- name: rake
96
- prerelease: false
97
- requirement: &id008 !ruby/object:Gem::Requirement
98
- none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: "0"
103
- type: :development
104
- version_requirements: *id008
14
+ date: 2012-11-14 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: bundler
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: !binary |-
23
+ MA==
24
+ none: false
25
+ requirement: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: !binary |-
30
+ MA==
31
+ none: false
32
+ prerelease: false
33
+ type: :runtime
34
+ - !ruby/object:Gem::Dependency
35
+ name: thor
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: !binary |-
41
+ MA==
42
+ none: false
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: !binary |-
48
+ MA==
49
+ none: false
50
+ prerelease: false
51
+ type: :runtime
52
+ - !ruby/object:Gem::Dependency
53
+ name: rubyzip
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: !binary |-
59
+ MA==
60
+ none: false
61
+ requirement: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: !binary |-
66
+ MA==
67
+ none: false
68
+ prerelease: false
69
+ type: :runtime
70
+ - !ruby/object:Gem::Dependency
71
+ name: jenkins-war
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - !binary |-
75
+ Pg==
76
+ - !ruby/object:Gem::Version
77
+ version: '1.427'
78
+ none: false
79
+ requirement: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - !binary |-
82
+ Pg==
83
+ - !ruby/object:Gem::Version
84
+ version: '1.427'
85
+ none: false
86
+ prerelease: false
87
+ type: :runtime
88
+ - !ruby/object:Gem::Dependency
89
+ name: jenkins-plugin-runtime
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ~>
93
+ - !ruby/object:Gem::Version
94
+ version: 0.2.3
95
+ none: false
96
+ requirement: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ~>
99
+ - !ruby/object:Gem::Version
100
+ version: 0.2.3
101
+ none: false
102
+ prerelease: false
103
+ type: :runtime
104
+ - !ruby/object:Gem::Dependency
105
+ name: rake
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: !binary |-
111
+ MA==
112
+ none: false
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: !binary |-
118
+ MA==
119
+ none: false
120
+ prerelease: false
121
+ type: :development
122
+ - !ruby/object:Gem::Dependency
123
+ name: cucumber
124
+ version_requirements: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ! '>='
127
+ - !ruby/object:Gem::Version
128
+ version: !binary |-
129
+ MA==
130
+ none: false
131
+ requirement: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ! '>='
134
+ - !ruby/object:Gem::Version
135
+ version: !binary |-
136
+ MA==
137
+ none: false
138
+ prerelease: false
139
+ type: :development
140
+ - !ruby/object:Gem::Dependency
141
+ name: aruba
142
+ version_requirements: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ! '>='
145
+ - !ruby/object:Gem::Version
146
+ version: !binary |-
147
+ MA==
148
+ none: false
149
+ requirement: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ! '>='
152
+ - !ruby/object:Gem::Version
153
+ version: !binary |-
154
+ MA==
155
+ none: false
156
+ prerelease: false
157
+ type: :development
105
158
  description: Allows you to generate a new Ruby plugin project, build it, test it in Jenkins and release it to the Jenkins Update Center.
106
- email:
107
- - cowboyd@thefrontside.net
108
- executables:
109
- - jpi
159
+ email:
160
+ - cowboyd@thefrontside.net
161
+ executables:
162
+ - jpi
110
163
  extensions: []
111
-
112
164
  extra_rdoc_files: []
113
-
114
- files:
115
- - Gemfile
116
- - README.md
117
- - Rakefile
118
- - bin/jpi
119
- - features/create-new-plugin.feature
120
- - features/support/create_new_plugin_steps.rb
121
- - features/support/directory_structure.rb
122
- - features/support/work.rb
123
- - jpi.gemspec
124
- - lib/jenkins/jenkins-ci.org/credential.rb
125
- - lib/jenkins/plugin/cli.rb
126
- - lib/jenkins/plugin/cli/formatting.rb
127
- - lib/jenkins/plugin/cli/generate.rb
128
- - lib/jenkins/plugin/cli/new.rb
129
- - lib/jenkins/plugin/cli/templates/Gemfile.tt
130
- - lib/jenkins/plugin/cli/templates/build_step.tt
131
- - lib/jenkins/plugin/cli/templates/build_wrapper.tt
132
- - lib/jenkins/plugin/cli/templates/computer_listener.tt
133
- - lib/jenkins/plugin/cli/templates/node_property.tt
134
- - lib/jenkins/plugin/cli/templates/pluginspec.tt
135
- - lib/jenkins/plugin/cli/templates/run_listener.tt
136
- - lib/jenkins/plugin/tools/bundle.rb
137
- - lib/jenkins/plugin/tools/hpi.rb
138
- - lib/jenkins/plugin/tools/loadpath.rb
139
- - lib/jenkins/plugin/tools/manifest.rb
140
- - lib/jenkins/plugin/tools/package.rb
141
- - lib/jenkins/plugin/tools/release.rb
142
- - lib/jenkins/plugin/tools/resolver.rb
143
- - lib/jenkins/plugin/tools/server.rb
144
- - lib/jenkins/plugin/tools/templates/release-pom.xml.erb
145
- - lib/jenkins/plugin/version.rb
146
- - lib/jenkins/rake.rb
165
+ files:
166
+ - Gemfile
167
+ - README.md
168
+ - Rakefile
169
+ - bin/jpi
170
+ - features/create-new-plugin.feature
171
+ - features/step_definitions/new_steps.rb
172
+ - features/support/directory_structure.rb
173
+ - features/support/env.rb
174
+ - features/support/workdir.rb
175
+ - jpi.gemspec
176
+ - lib/jenkins/jenkins-ci.org/credential.rb
177
+ - lib/jenkins/plugin/cli.rb
178
+ - lib/jenkins/plugin/cli/formatting.rb
179
+ - lib/jenkins/plugin/cli/generate.rb
180
+ - lib/jenkins/plugin/cli/new.rb
181
+ - lib/jenkins/plugin/cli/templates/Gemfile.tt
182
+ - lib/jenkins/plugin/cli/templates/build_step.tt
183
+ - lib/jenkins/plugin/cli/templates/build_wrapper.tt
184
+ - lib/jenkins/plugin/cli/templates/computer_listener.tt
185
+ - lib/jenkins/plugin/cli/templates/node_property.tt
186
+ - lib/jenkins/plugin/cli/templates/pluginspec.tt
187
+ - lib/jenkins/plugin/cli/templates/run_listener.tt
188
+ - lib/jenkins/plugin/tools/bundle.rb
189
+ - lib/jenkins/plugin/tools/hpi.rb
190
+ - lib/jenkins/plugin/tools/loadpath.rb
191
+ - lib/jenkins/plugin/tools/manifest.rb
192
+ - lib/jenkins/plugin/tools/package.rb
193
+ - lib/jenkins/plugin/tools/release.rb
194
+ - lib/jenkins/plugin/tools/resolver.rb
195
+ - lib/jenkins/plugin/tools/server.rb
196
+ - lib/jenkins/plugin/tools/templates/release-pom.xml.erb
197
+ - lib/jenkins/plugin/version.rb
198
+ - lib/jenkins/rake.rb
147
199
  homepage: https://github.com/jenkinsci/jenkins.rb/tree/master/ruby-tools/jpi
148
200
  licenses: []
149
-
150
- post_install_message:
201
+ post_install_message:
151
202
  rdoc_options: []
152
-
153
- require_paths:
154
- - lib
155
- required_ruby_version: !ruby/object:Gem::Requirement
203
+ require_paths:
204
+ - lib
205
+ required_ruby_version: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ! '>='
208
+ - !ruby/object:Gem::Version
209
+ version: !binary |-
210
+ MA==
156
211
  none: false
157
- requirements:
158
- - - ">="
159
- - !ruby/object:Gem::Version
160
- version: "0"
161
- required_rubygems_version: !ruby/object:Gem::Requirement
212
+ required_rubygems_version: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - ! '>='
215
+ - !ruby/object:Gem::Version
216
+ version: !binary |-
217
+ MA==
162
218
  none: false
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: "0"
167
219
  requirements: []
168
-
169
- rubyforge_project:
170
- rubygems_version: 1.8.15
171
- signing_key:
220
+ rubyforge_project:
221
+ rubygems_version: 1.8.24
222
+ signing_key:
172
223
  specification_version: 3
173
224
  summary: Tools for creating and building Jenkins Ruby plugins
174
- test_files:
175
- - features/create-new-plugin.feature
176
- - features/support/create_new_plugin_steps.rb
177
- - features/support/directory_structure.rb
178
- - features/support/work.rb
225
+ test_files:
226
+ - features/create-new-plugin.feature
227
+ - features/step_definitions/new_steps.rb
228
+ - features/support/directory_structure.rb
229
+ - features/support/env.rb
230
+ - features/support/workdir.rb
@@ -1,20 +0,0 @@
1
- module Work
2
- def run cmd
3
- Dir.chdir(work_dir) do
4
- root = Pathname(__FILE__).join('..', '..', '..')
5
- full_cmd = "ruby -rubygems -I #{root.join('lib')} -S #{root.join('bin',cmd)}"
6
- system(full_cmd) or fail "failed to run command #{cmd}"
7
- end
8
- end
9
-
10
- def work_dir
11
- @work_dir ||= File.expand_path("tmp/work")
12
- end
13
- end
14
-
15
- Before do
16
- FileUtils.rm_rf work_dir
17
- FileUtils.mkdir_p work_dir
18
- end
19
-
20
- World(Work)