emeril 0.5.0 → 0.5.1
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.
- data/CHANGELOG.md +11 -0
- data/README.md +32 -2
- data/images/emeril-vid.png +0 -0
- data/lib/emeril/releaser.rb +8 -4
- data/lib/emeril/version.rb +1 -1
- data/spec/emeril/releaser_spec.rb +17 -0
- metadata +4 -3
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 0.5.1 / 2013-05-23
|
|
2
|
+
|
|
3
|
+
### New features
|
|
4
|
+
|
|
5
|
+
* Pull request [#1][]: Add ability to bypass publishing to the community site. ([@thbishop][])
|
|
6
|
+
|
|
7
|
+
|
|
1
8
|
## 0.5.0 / 2013-05-20
|
|
2
9
|
|
|
3
10
|
The initial release, **BAM**!
|
|
11
|
+
|
|
12
|
+
<!--- The following link definition list is generated by PimpMyChangelog --->
|
|
13
|
+
[#1]: https://github.com/fnichol/emeril/issues/1
|
|
14
|
+
[@thbishop]: https://github.com/thbishop
|
data/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# <a name="title"></a> Emeril: Tag And Release Chef Cookbooks As A Library
|
|
2
2
|
|
|
3
|
+
[](http://badge.fury.io/rb/emeril)
|
|
3
4
|
[](https://travis-ci.org/fnichol/emeril)
|
|
4
|
-
[](https://gemnasium.com/fnichol/emeril)
|
|
5
5
|
[](https://codeclimate.com/github/fnichol/emeril)
|
|
6
|
+
[](https://gemnasium.com/fnichol/emeril)
|
|
6
7
|
|
|
7
8
|
Kick it up a notch! Emeril is a library that helps you release your Chef
|
|
8
9
|
cookbooks from Rake, Thor, or a Ruby library. If `rake release` is all you
|
|
@@ -23,13 +24,20 @@ bundle exec rake release
|
|
|
23
24
|
|
|
24
25
|
Need more details? Read on…
|
|
25
26
|
|
|
27
|
+
## <a name="screencast"></a> Screencast
|
|
28
|
+
|
|
29
|
+
Here is a short screencast demonstating how Emeril can be used to release
|
|
30
|
+
a cookbook to the Community Site.
|
|
31
|
+
|
|
32
|
+
[](http://vimeo.com/fnichol/emeril)
|
|
33
|
+
|
|
26
34
|
## <a name="how-it-works"></a> How It Works
|
|
27
35
|
|
|
28
36
|
Emeril has 2 primary tasks and goals:
|
|
29
37
|
|
|
30
38
|
1. Tag a Git commit with a semantic version tag with the form `"v1.2.5"` (by
|
|
31
39
|
default)
|
|
32
|
-
2.
|
|
40
|
+
2. Optionally publish a versioned release of the cookbook to the
|
|
33
41
|
[Community Site][community_site]
|
|
34
42
|
|
|
35
43
|
The Git tagging is currently accomplished via shell out, so Git must be
|
|
@@ -131,6 +139,17 @@ Emeril::RakeTasks.new do |t|
|
|
|
131
139
|
end
|
|
132
140
|
```
|
|
133
141
|
|
|
142
|
+
If your cookbook is not on the Community Site, you can skip the publishing step
|
|
143
|
+
with the block form:
|
|
144
|
+
|
|
145
|
+
```ruby
|
|
146
|
+
require 'emeril/rake_tasks'
|
|
147
|
+
|
|
148
|
+
Emeril::RakeTasks.new do |t|
|
|
149
|
+
t.config[:publish_to_community] = false
|
|
150
|
+
end
|
|
151
|
+
```
|
|
152
|
+
|
|
134
153
|
### <a name="usage-rake"></a> Thor Tasks
|
|
135
154
|
|
|
136
155
|
To add the default Thor task (`thor emeril:release`), add the following to your
|
|
@@ -158,6 +177,17 @@ Emeril::ThorTasks.new do |t|
|
|
|
158
177
|
end
|
|
159
178
|
```
|
|
160
179
|
|
|
180
|
+
If your cookbook is not on the Community Site, you can skip the publishing step
|
|
181
|
+
with the block form:
|
|
182
|
+
|
|
183
|
+
```ruby
|
|
184
|
+
require 'emeril/thor_tasks'
|
|
185
|
+
|
|
186
|
+
Emeril::ThorTasks.new do |t|
|
|
187
|
+
t.config[:publish_to_community] = false
|
|
188
|
+
end
|
|
189
|
+
```
|
|
190
|
+
|
|
161
191
|
### <a name="usage-ruby"></a> Ruby Library
|
|
162
192
|
|
|
163
193
|
The Ruby API is fairly straight forward, but keep in mind that loading or
|
|
Binary file
|
data/lib/emeril/releaser.rb
CHANGED
|
@@ -7,8 +7,8 @@ require 'emeril/publisher'
|
|
|
7
7
|
|
|
8
8
|
module Emeril
|
|
9
9
|
|
|
10
|
-
# Tags a git commit with a version string and pushes the
|
|
11
|
-
# Community Site.
|
|
10
|
+
# Tags a git commit with a version string and (optionally) pushes the
|
|
11
|
+
# cookbook to the Community Site.
|
|
12
12
|
#
|
|
13
13
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
14
14
|
#
|
|
@@ -24,6 +24,9 @@ module Emeril
|
|
|
24
24
|
# cookbook
|
|
25
25
|
# @option options [GitTagger] git_tagger a git tagger
|
|
26
26
|
# @option options [Publisher] publisher a publisher
|
|
27
|
+
# @option options [Boolean] publish_to_community a boolean which
|
|
28
|
+
# controls if the cookbook will published on the Community Site (the
|
|
29
|
+
# default is to publish)
|
|
27
30
|
# @raise [ArgumentError] if any required options are not set
|
|
28
31
|
#
|
|
29
32
|
def initialize(options = {})
|
|
@@ -34,13 +37,14 @@ module Emeril
|
|
|
34
37
|
@category = options.fetch(:category) { default_category }
|
|
35
38
|
@git_tagger = options.fetch(:git_tagger) { default_git_tagger }
|
|
36
39
|
@publisher = options.fetch(:publisher) { default_publisher }
|
|
40
|
+
@publish_to_community = options.fetch(:publish_to_community) { true }
|
|
37
41
|
end
|
|
38
42
|
|
|
39
43
|
# Tags and releases a cookbook.
|
|
40
44
|
#
|
|
41
45
|
def run
|
|
42
46
|
git_tagger.run
|
|
43
|
-
publisher.run
|
|
47
|
+
publisher.run if publish_to_community
|
|
44
48
|
end
|
|
45
49
|
|
|
46
50
|
private
|
|
@@ -48,7 +52,7 @@ module Emeril
|
|
|
48
52
|
DEFAULT_CATEGORY = "Other".freeze
|
|
49
53
|
|
|
50
54
|
attr_reader :logger, :tag_prefix, :source_path, :metadata,
|
|
51
|
-
:category, :git_tagger, :publisher
|
|
55
|
+
:category, :git_tagger, :publisher, :publish_to_community
|
|
52
56
|
|
|
53
57
|
def default_metadata
|
|
54
58
|
metadata_file = File.expand_path(File.join(source_path, "metadata.rb"))
|
data/lib/emeril/version.rb
CHANGED
|
@@ -137,5 +137,22 @@ describe Emeril::Releaser do
|
|
|
137
137
|
|
|
138
138
|
releaser.run
|
|
139
139
|
end
|
|
140
|
+
|
|
141
|
+
describe 'when disabling community site publishing' do
|
|
142
|
+
it 'does not call #run on publisher' do
|
|
143
|
+
releaser = Emeril::Releaser.new(
|
|
144
|
+
:metadata => metadata,
|
|
145
|
+
:category => category,
|
|
146
|
+
:git_tagger => git_tagger,
|
|
147
|
+
:publisher => publisher,
|
|
148
|
+
:publish_to_community => false
|
|
149
|
+
)
|
|
150
|
+
publisher.unstub(:run)
|
|
151
|
+
publisher.expects(:run).never
|
|
152
|
+
|
|
153
|
+
releaser.run
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
end
|
|
140
157
|
end
|
|
141
158
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: emeril
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-05-
|
|
12
|
+
date: 2013-05-23 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: chef
|
|
@@ -253,6 +253,7 @@ files:
|
|
|
253
253
|
- README.md
|
|
254
254
|
- Rakefile
|
|
255
255
|
- emeril.gemspec
|
|
256
|
+
- images/emeril-vid.png
|
|
256
257
|
- lib/emeril.rb
|
|
257
258
|
- lib/emeril/category.rb
|
|
258
259
|
- lib/emeril/git_tagger.rb
|
|
@@ -294,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
294
295
|
version: '0'
|
|
295
296
|
segments:
|
|
296
297
|
- 0
|
|
297
|
-
hash:
|
|
298
|
+
hash: 2430301425435120469
|
|
298
299
|
requirements: []
|
|
299
300
|
rubyforge_project:
|
|
300
301
|
rubygems_version: 1.8.24
|