checklister 0.9.4 → 0.9.5

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: 78e466de3b78da29b9b12e95aa4778da7c1efaf5
4
- data.tar.gz: 7db9691ccbe80398e451d53ea4c7dbb76166af02
3
+ metadata.gz: 2c4f8292b102faa5816ffb45782ddea41d891861
4
+ data.tar.gz: 969a43bbbd9d81141e21ba2fccf6b0eebd8fe41f
5
5
  SHA512:
6
- metadata.gz: b1b58654ba268f84156437ce39dd08c1aed82478867c50066883f52045daa9a947739747e71d77271ee6b0008e4712ef1200626ea66c9b0fee57ac001e8e4317
7
- data.tar.gz: 3ce3e01fbe39938bb457fb2eac7396cb84ba89329d95a6c3d21d8863d1181196cad5396547f4039a1c2df20212e89bab96ca83d3719f7e38d7d01412a6c144c9
6
+ metadata.gz: 8b59c8df39e808d2e79f8db3b65603b0c882df0cfc44adb0e5b0d2a1d92fa216eeedb99c40a2d9e8fdd26ddadf52a618b9f2dd8a4cdcf01211b683ffa4925dd7
7
+ data.tar.gz: 1e344a97012d2242142782923a7f3c880d33173778caad9775b881882c19acd6e931ca3426815369254272dd391bea067fd4ddc3a608ced5cd2fc0c5b3022e01
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  NOTE: the project follows [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## 0.9.5 - 2015-09-29
7
+
8
+ ### Added
9
+
10
+ - [feature] We should be able to override the issue's title we create with a CLI option
11
+
6
12
  ## 0.9.4 - 2015-09-26
7
13
 
8
14
  ### Fixed
data/README.md CHANGED
@@ -18,7 +18,7 @@ Checklister is a CLI packaged as a Ruby gem giving you the power to transform an
18
18
  A checklist is an ideal tool to help people remembering all of the steps required to accomplish complicated tasks and objectives.
19
19
  Using a checklist enforces best practices, even if they seem obvious at first, preventing costly mistakes.
20
20
 
21
- ### the checklist manifesto
21
+ ### The checklist manifesto
22
22
 
23
23
  A great book to read for more inspiration about the power of checklist:
24
24
 
@@ -74,6 +74,12 @@ Once the file is parsed, a Github issue will be created with its content. In thi
74
74
 
75
75
  ![Github Issue](http://i.imgur.com/1IwGKaS.png)
76
76
 
77
+ Alternatively, you can set a custom title for your issue with the `-t` or `--title` option :
78
+
79
+ ```bash
80
+ $ checklister new --checklist /path/to/simple-checklist.md --title "A custom title"
81
+ ```
82
+
77
83
  ## Development Setup
78
84
 
79
85
  ### Dependencies
@@ -133,7 +139,6 @@ To prepare a release, run `script/release`. This will package a new version of t
133
139
 
134
140
  - [ ] [improvements] CLI improvements based on first test run with real users
135
141
  - [ ] [documentation] Yard documentation updated
136
- - [ ] [feature] Create a new Issue based on a specific markdown file (remote path)
137
142
  - [x] [feature] Connect to github account
138
143
 
139
144
  ### Wishlist
@@ -142,6 +147,7 @@ To prepare a release, run `script/release`. This will package a new version of t
142
147
  - [ ] [feature] Select a milestone from a list populated based on github/gitlab API
143
148
  - [ ] [feature] Select a checklist from an history list
144
149
  - [ ] [feature] Connect to a bitbucket account
150
+ - [ ] [feature] Create a new Issue based on a specific markdown file (remote path)
145
151
 
146
152
  ## Authors
147
153
 
@@ -116,10 +116,12 @@ end
116
116
  desc "Transform a markdown file or url checklist into an actionable issue"
117
117
  command :new do |c|
118
118
  c.flag [:c,:checklist], desc: "Set the markdown checklist file path", required: true
119
+ c.flag [:t,:title], desc: "Set a custom issue title"
119
120
  c.action do |global_options,options,args|
120
121
  api_client = Checklister::Client.new(Checklister.config.to_hash)
121
122
  project_client = api_client.project
122
123
  checklist_path = options[:checklist]
124
+ title = options[:title]
123
125
 
124
126
  puts "* Type some letters of your project's name..."
125
127
  project_like = STDIN.gets.chomp
@@ -134,7 +136,7 @@ command :new do |c|
134
136
  project = project_client.get(project_id)
135
137
  puts "* Creating a checklist issue from #{checklist_path}"
136
138
  puts " to the project: #{project[:name]}"
137
- parsed_checklist = Checklister::Parser.new(checklist_path)
139
+ parsed_checklist = Checklister::Parser.new(checklist_path, title)
138
140
  issue = api_client.issue.create(project_id, parsed_checklist.to_params)
139
141
  puts "* Issue successfully created!"
140
142
  end
@@ -9,19 +9,19 @@ module Checklister
9
9
  #
10
10
  class Parser
11
11
  # @param [String] file_path the path of the markdown file to parse
12
- def initialize(file_path)
12
+ def initialize(file_path, title = nil)
13
13
  @file_content = File.open(file_path).read
14
+ @title = title
14
15
  end
15
16
 
16
17
  # @return [Hash] a hash of params
17
18
  def to_params
18
- title = ""
19
19
  checklist = []
20
20
 
21
21
  @file_content.each_line do |line|
22
22
  # Extract a title, when we find the first <h1> header
23
- if title == "" && line.start_with?("# ")
24
- title = line.sub("# ", "").sub("\n", "")
23
+ if @title.nil? && line.start_with?("# ")
24
+ @title = line.sub("# ", "").sub("\n", "")
25
25
  else
26
26
  # Then, keep the text intact until the end of the file
27
27
  checklist << line
@@ -29,10 +29,10 @@ module Checklister
29
29
  end
30
30
 
31
31
  # Default title, if no <H1> header found
32
- title = "Checklist" if title == ""
32
+ @title = "Checklist" if @title.nil?
33
33
 
34
34
  # Return the parsed text as an object
35
- { title: title, body: checklist.join }
35
+ { title: @title, body: checklist.join }
36
36
  end
37
37
  end
38
38
  end
@@ -1,3 +1,3 @@
1
1
  module Checklister
2
- VERSION = "0.9.4"
2
+ VERSION = "0.9.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checklister
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Thouret
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-26 00:00:00.000000000 Z
12
+ date: 2015-09-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gitlab