amanuensis 1.0.0 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6d31e90bdbc3a3fd422124fc0429c1b0895dd8e
4
- data.tar.gz: ca8759f8ae3ae360e3bfba91925c4935f684f2ba
3
+ metadata.gz: a5d4bf2058cf6a5ddeefdffaa4301dfaeb39c788
4
+ data.tar.gz: e2580010a8018e2e5635d9cf2edf04d03cf66234
5
5
  SHA512:
6
- metadata.gz: 4d4043f7916c87e5718a69fbc1d020ce4ec4318bd863b166f1b0e0a52a86dfdb0281cd20c275dd974c9fe10fe7690ece1a1c2f6db0bb6824832f1a2d0fbcac7d
7
- data.tar.gz: dd4a6deb5bf917d7e74f1e0aa4ab54834a4f9f44bc8a5b27b1a89e4269e28810a47a09b7b213411f476aaef824b5cf60beede42ebf793527918c8e6c0314ec53
6
+ metadata.gz: a150002af3d39f88ece4750e33840071c05743f21bd8faa6953f022921e22142497b01b6afb4093f55d11cbc39a83f0357911a2368dc9b94707bf819c28075c0
7
+ data.tar.gz: 766fd67345d0c8494a47447d8bb36c3aa8fc6c8f1ac9521d001fb882ed30ac33dfb89e7225e55885b2a46ccd3ecbc35e6f25695fda4310880aa3c20f55851274
@@ -0,0 +1,18 @@
1
+ ## 1.0.1-03/05/2015 22:05:20
2
+
3
+ **Issues closed:**
4
+ * [#6](https://github.com/alaibe/amanuensis/issues/6) Use HashWithIndifferentAccess for pony params
5
+ * [#5](https://github.com/alaibe/amanuensis/issues/5) Create changelog without release
6
+
7
+ **Pull requests closed:**
8
+ * [#4](https://github.com/alaibe/amanuensis/pull/4) Use symbol keys for pony options
9
+
10
+ ## 1.0.0-12/04/2015 21:51:19
11
+
12
+ **Issues closed:**
13
+ * [#1](https://github.com/alaibe/amanuensis/issues/1) First issue
14
+
15
+ **Pull requests closed:**
16
+ * [#3](https://github.com/alaibe/amanuensis/pull/3) Test branch
17
+ * [#2](https://github.com/alaibe/amanuensis/pull/2) Fix filter
18
+
data/README.md CHANGED
@@ -114,7 +114,7 @@ The changelog will also contains all pull requests closed since the latest relea
114
114
 
115
115
  Via command line:
116
116
  ```
117
- amanuensis generator --github=oauth_token:my_token repo:alaibe/amanuensis
117
+ amanuensis generate --github=oauth_token:my_token repo:alaibe/amanuensis
118
118
  ```
119
119
 
120
120
  Via Ruby:
@@ -133,7 +133,7 @@ If github is used, the changelog will contains the closed issues since the last
133
133
 
134
134
  Via command line:
135
135
  ```
136
- amanuensis generator --github=oauth_token:my_token repo:alaibe/amanuensis
136
+ amanuensis generate --github=oauth_token:my_token repo:alaibe/amanuensis
137
137
  ```
138
138
 
139
139
  Via Ruby:
@@ -148,7 +148,7 @@ If trello is used, the changelog will contains the closed cards since the last r
148
148
 
149
149
  Via command line:
150
150
  ```
151
- amanuensis generator --trello=key:my_key token:my_token board:amanuensis list:done
151
+ amanuensis generate --trello=key:my_key token:my_token board:amanuensis list:done
152
152
  ```
153
153
 
154
154
  Via Ruby:
@@ -165,7 +165,7 @@ If pivotal is used, the changelog will contains the accepted cards since the las
165
165
 
166
166
  Via command line:
167
167
  ```
168
- amanuensis generator --pivotal=token:my_token project:amanuensis
168
+ amanuensis generate --pivotal=token:my_token project:amanuensis
169
169
  ```
170
170
 
171
171
  Via Ruby:
@@ -192,7 +192,7 @@ If you use github to push your changelog, it will be append to the file named Ch
192
192
 
193
193
  Via command line:
194
194
  ```
195
- amanuensis generator --github=oauth_token:my_token repo:alaibe/amanuensis
195
+ amanuensis generate --github=oauth_token:my_token repo:alaibe/amanuensis
196
196
  file_name:new_changelog.md
197
197
  ```
198
198
 
@@ -210,14 +210,16 @@ The option ```file_name``` is not required and is set to ```Changelog.md``` by d
210
210
  We use the gem pony in order to send mail
211
211
  See the gem readme for all the options available: https://github.com/benprew/pony
212
212
 
213
+ All nested hash params are flatten for the command line
214
+
213
215
  Via command line:
214
216
  ```
215
- amanuensis generator --mail=to:anthony@amanuensis.com
217
+ amanuensis generate --mail=to:anthony@amanuensis.com via_options_port:25
216
218
  ```
217
219
 
218
220
  Via Ruby:
219
221
  ```ruby
220
- Amanuensis::Mail.pony = { to: 'anthony@amanuensis.com' }
222
+ Amanuensis::Mail.pony = { to: 'anthony@amanuensis.com', via_options: { port: 25 }}
221
223
  ```
222
224
 
223
225
  ##### File
@@ -225,7 +227,7 @@ Amanuensis::Mail.pony = { to: 'anthony@amanuensis.com' }
225
227
  If you export push your changelog with the file option, it will create a file named ```Changelog.md``` by default
226
228
 
227
229
  ```
228
- amanuensis generator --file=file_name:new_changelog.md
230
+ amanuensis generate --file=file_name:new_changelog.md
229
231
  ```
230
232
 
231
233
  Via Ruby:
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require_relative '../lib/amanuensis'
4
- require 'pry'
5
4
 
6
5
  Amanuensis::CLI.start(ARGV)
@@ -1,7 +1,9 @@
1
1
  require 'interchange'
2
2
  require 'thor'
3
3
  require 'active_support/core_ext/object/blank'
4
+ require 'active_support/core_ext/hash'
4
5
  require 'active_support/configurable'
6
+ require 'active_support/hash_with_indifferent_access'
5
7
 
6
8
  require_relative 'amanuensis/version'
7
9
  require_relative 'amanuensis/validatable'
@@ -31,6 +33,7 @@ module Amanuensis
31
33
  config_accessor(:tracker) { :github }
32
34
  config_accessor(:code_manager) { :github }
33
35
  config_accessor(:verbose) { false }
36
+ config_accessor(:release) { true }
34
37
  config_accessor(:version) { :patch }
35
38
 
36
39
  validate_presence_of :push, :tracker, :code_manager, :version
@@ -6,6 +6,7 @@ module Amanuensis
6
6
  option :tracker, type: :string, aliases: :t, default: :github
7
7
  option :code_manager, type: :string, aliases: :c, default: :github
8
8
  option :version, type: :string, aliases: :u, default: :patch
9
+ option :release, type: :boolean, aliases: :r, default: true
9
10
  option :verbose, type: :boolean, aliases: :v, default: false
10
11
  option :github, type: :hash, aliases: :g
11
12
  option :trello, type: :hash, aliases: :c
@@ -18,6 +19,7 @@ module Amanuensis
18
19
  Amanuensis.code_manager = options.code_manager
19
20
  Amanuensis.version = options.version
20
21
  Amanuensis.verbose = options.verbose
22
+ Amanuensis.release = options.release
21
23
 
22
24
  if options.github.present?
23
25
  options.github.each do |key, value|
@@ -43,12 +45,33 @@ module Amanuensis
43
45
  end
44
46
  end
45
47
 
46
- Amanuensis::Mail.pony = options.mail
48
+ if options.mail.present?
49
+ pony = extract_pony_options!(options.mail)
50
+ Amanuensis::Mail.pony = pony
51
+ end
47
52
 
48
53
  Amanuensis.generate
49
54
  rescue ValidationError => e
50
55
  puts e.message
51
56
  end
52
57
 
58
+ private
59
+
60
+ VIA_OPTIONS = 'via_options'
61
+
62
+ def extract_pony_options!(options = {})
63
+ via_options = options[VIA_OPTIONS] ||= {}
64
+
65
+ options.each do |key, value|
66
+ if key != VIA_OPTIONS && key.start_with?(VIA_OPTIONS)
67
+ sub_key = key.gsub("#{VIA_OPTIONS}_", '')
68
+ via_options[sub_key.to_sym] = value
69
+ options.delete(key)
70
+ end
71
+ end
72
+
73
+ options
74
+ end
75
+
53
76
  end
54
77
  end
@@ -48,6 +48,8 @@ module Amanuensis
48
48
  end
49
49
 
50
50
  def create_release
51
+ return unless Amanuensis.release
52
+
51
53
  verbose 'Create release' do
52
54
  CodeManager.create_release version
53
55
  end
@@ -3,7 +3,13 @@ module Amanuensis
3
3
  class Push
4
4
 
5
5
  def run(changelog)
6
- Pony.mail Mail.pony.merge(body: changelog)
6
+ Pony.mail options.merge(body: changelog)
7
+ end
8
+
9
+ private
10
+
11
+ def options
12
+ HashWithIndifferentAccess.new Mail.pony
7
13
  end
8
14
 
9
15
  end
@@ -1,5 +1,5 @@
1
1
  module Amanuensis
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
 
4
4
  class Version < Struct.new(:tag)
5
5
 
@@ -7,9 +7,9 @@ describe 'Mail Amanuensis' do
7
7
  Amanuensis.code_manager = :fake
8
8
  Amanuensis.tracker = :fake
9
9
 
10
- Amanuensis::Mail.pony = { to: 'foo@bar.com' }
10
+ Amanuensis::Mail.pony = { 'to' => 'foo@bar.com' }
11
11
 
12
- expect(Pony).to receive(:mail)
12
+ expect(Pony).to receive(:mail).with(to: 'foo@bar.com', body: /.*/)
13
13
  Amanuensis.generate
14
14
  end
15
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amanuensis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Laibe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-12 00:00:00.000000000 Z
11
+ date: 2015-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -218,6 +218,7 @@ files:
218
218
  - ".env.sample"
219
219
  - ".gitignore"
220
220
  - ".rspec"
221
+ - Changelog.md
221
222
  - Gemfile
222
223
  - LICENSE.txt
223
224
  - README.md