ididthis 0.1.2.2 → 0.1.3.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7eef1ca113cb6f7f7151a0fb533ba96cb2090c5
4
- data.tar.gz: f6acc704273c5c8430d7566f82d2cc5d0d166a4b
3
+ metadata.gz: 97e227310531a18cb4dc7af1f534c2e9a52e0afd
4
+ data.tar.gz: 23dbf1ccc3710811552b8057303c63e0afd20dba
5
5
  SHA512:
6
- metadata.gz: e681260d028ad331b67777710fa2ea952713bef105bec6bb4447c8db7ea2d1650b09e8647890018ac26022d2c606a45d45b14287da2c5a35d5aee9feb5dbb075
7
- data.tar.gz: 9050b2d5bf38df02c52751dcf697d948c2e842bf6c2382c7b9e01e64046e30d56aa3100a80035aabc464292cfffef4d7eff3d95845630222f956d1f5b1c34c9b
6
+ metadata.gz: eaa91236eb836e7d6d1d6b0ede7f036bbdeb0ccd440ff305780730af8ed7b7b61e31b5bcb26bcdb963c7b30ff3ce2a04135c1752f988841d54605bb12f0aaa1a
7
+ data.tar.gz: df74c206815aeb92497617da63a39f284176121685f8e2dd6fdfc490bc7251aa2dff2bd147b882c4fd3decb13cd1872ceba1f6059492bfb7d2f44734c352314d
data/.travis.yml CHANGED
@@ -8,10 +8,14 @@ rvm:
8
8
  before_install:
9
9
  - gem install bundler -v 1.10.2
10
10
  script:
11
- - bundle exec rake test
11
+ - bundle exec rake test
12
12
  notifications:
13
13
  pushover:
14
14
  api_key:
15
15
  secure: B4aN8EQW8mVLk14cgY8MeZuUCj3UsoVsYvDPNIPOrWLCxdyIFSdE0ncIzejGKyfE+hIzEFEO8shBBRXu4GksEemj3RD5hm7rNMtOGbcSDq7+Bm03MU65RABDsXm4JFwCop770ZEtVbEuTmivA33Upaxlw6cBwjS8EgYVnjI60IfOiQePD5hc0X8dcGYDzxe05tzEFB8KJxUDsajfUdXFkRcRhwKrrFggs6OIRl+h35OYFs2IkYYKxRkvfsU2L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Jbpu3QUlDP4MvtH1vqZD1hOBUDqAlAIGD+4Wfd8JqUxAAxyAmnO8VpISE=
18
+ hipchat:
19
+ rooms:
20
+ secure: XVqRC/Dv8v4BnyAkVKMKGDrsF8tl8J9kyB6j3KkmpMJv4kbOBdKm8GwdmgKoKtExeP83rnjVbsXvIBsw3ejFKDvA4HoeJSHuL/qwy1l0NZWI6fP73KkEK61fzAh3XjaukM6OHhXoGFnDVEfwTQX/FHdUn9gS60XMHvbwelS9RpFBH0Q4OKB2QbqkdNdMAiMjphEjwwI6+JPQlfCf+lN4Ol+CzCWScDsJtkx06ysG6Td4FvEyNXx5t98UjzCjpuwwJwQj1KuBin0B/rkXWXW0n8qWor/zvO94Lb+A1DruS/+phEI4a55oaEBNLZEqv1k+b/GsnhJ5gtSxO2TE55c9dKE/uRVJOKqxcoI5X/SODNf/9tqS9e5Ex5l7E/eUAsmb8zLCPJcIqmXV2qqShu3ju54SD3loCDkVLcLvzYMJyNB4KZhUaHCoDc8e2auOFlKebtMNtChxgCuPkyS1Z6mc7uSxt+BUwUZra2vxnd7N/VIMwAtugogxgZvfa4vddIy3bJnOKJp7sg1K88gZHDZu9y3Dq0z0N0AGTkgEzIighPtkvWvVlQGVpa+b8HBLYHmnN9vFF1h2v9Fo972nHvcwnIKkiTFOS+MV/fdt1kXKx9OQxGc047m1DxL4o/l8Yu5gOFADYUk5M928Q4a0UJTwKpWIzfgHtoNjqD1pO0EjYao=
21
+ notify: true
data/Guardfile ADDED
@@ -0,0 +1,48 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Note: The cmd option is now required due to the increasing number of ways
19
+ # rspec may be run, below are examples of the most common uses.
20
+ # * bundler: 'bundle exec rspec'
21
+ # * bundler binstubs: 'bin/rspec'
22
+ # * spring: 'bin/rspec' (This will use spring if running and you have
23
+ # installed the spring binstubs per the docs)
24
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
25
+ # * 'just' rspec: 'rspec'
26
+
27
+ guard :rspec, cmd: "bundle exec rspec" do
28
+ require "guard/rspec/dsl"
29
+ dsl = Guard::RSpec::Dsl.new(self)
30
+
31
+ # Feel free to open issues for suggestions and improvements
32
+
33
+ # RSpec files
34
+ rspec = dsl.rspec
35
+ watch(rspec.spec_helper) { rspec.spec_dir }
36
+ watch(rspec.spec_support) { rspec.spec_dir }
37
+ watch(rspec.spec_files)
38
+
39
+ # Ruby files
40
+ ruby = dsl.ruby
41
+ dsl.watch_spec_files_for(ruby.lib_files)
42
+
43
+ end
44
+
45
+ guard :rubocop do
46
+ watch(%r{.+\.rb$})
47
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
48
+ end
data/exe/ididthis CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "ididthis"
3
3
 
4
- Ididthis::CommandLine.start(ARGV)
4
+ Ididthis::CLI.start(ARGV)
data/ididthis.gemspec CHANGED
@@ -34,4 +34,9 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "rubocop", "~> 0.33"
35
35
  spec.add_development_dependency "rubocop-rspec", "~> 1.3"
36
36
  spec.add_development_dependency "codeclimate-test-reporter", "~> 0.4"
37
+ spec.add_development_dependency "guard", "~> 2.0"
38
+ spec.add_development_dependency "guard-rspec", "~> 4.0"
39
+ spec.add_development_dependency "guard-rubocop", "~> 1.0"
40
+ spec.add_development_dependency "terminal-notifier-guard"
41
+ spec.add_development_dependency "libnotify"
37
42
  end
data/lib/ididthis/cli.rb CHANGED
@@ -4,11 +4,13 @@ require "ididthis"
4
4
 
5
5
  module Ididthis
6
6
  # Class providing the command line interface processing
7
- class CommandLine < Thor
7
+ class CLI < Thor # rubocop:disable Metrics/ClassLength
8
8
  class_option :color,
9
9
  :type => :boolean,
10
10
  :default => true,
11
11
  :desc => "Colorize output"
12
+ stop_on_unknown_option! :post
13
+ check_unknown_options! :except => :post
12
14
 
13
15
  desc "configure", "(Re)configure the client."
14
16
  long_desc <<-CONFIGURE
@@ -44,13 +46,12 @@ module Ididthis
44
46
  :aliases => "-g",
45
47
  :type => :boolean,
46
48
  :desc => "Post a goal rather than a done"
47
- def post(done)
48
- post_options = {}
49
- post_options[:done_date] = options[:date] if options[:date]
50
- post_options[:meta_data] = options[:metadata] if options[:metadata]
49
+ def post(*done)
50
+ text = done.join(" ")
51
+ post_options = map_post_options
51
52
  c = Ididthis::API::Client.new(Ididthis::Config[:token])
52
53
  c.post_done(
53
- options[:goal] ? "[] #{done}" : done, options[:team],
54
+ options[:goal] ? "[] #{text}" : text, options[:team],
54
55
  post_options
55
56
  )
56
57
  end
@@ -119,30 +120,29 @@ module Ididthis
119
120
 
120
121
  private
121
122
 
122
- # TODO: Break output to separate formatter classes
123
+ def map_post_options
124
+ post_options = {}
125
+ post_options[:done_date] = options[:date] if options[:date]
126
+ post_options[:meta_data] = options[:metadata] if options[:metadata]
127
+
128
+ post_options
129
+ end
130
+
123
131
  def print_dones(dones)
124
- dones.each do |done|
125
- print format_column(done[:done_date], COLORS[:yellow])
126
- print format_column(done[:owner], COLORS[:green], " ")
127
- puts format_column(highlight_tags(done[:raw_text]), "", "\t")
128
- end
132
+ print_table(
133
+ dones.map do |done|
134
+ [
135
+ set_color(done[:done_date], :yellow),
136
+ set_color(done[:owner], :green),
137
+ highlight_tags(done[:raw_text])
138
+ ]
139
+ end,
140
+ :indent => 4
141
+ )
129
142
  end
130
143
 
131
144
  def highlight_tags(done_text)
132
145
  options[:color] ? done_text.gsub(/(#\b[^\s]+\b)/, "\e[31m\\1\e[0m") : done_text
133
146
  end
134
-
135
- def format_column(text, color_code, prefix = "", suffix = "")
136
- column_text = "#{prefix}#{color_code if options[:color] && color_code}"
137
- column_text += text
138
- column_text += "#{COLORS[:reset] if options[:color] && color_code}#{suffix}"
139
- end
140
-
141
- COLORS = {
142
- reset: "\e[0m",
143
- red: "\e[31m",
144
- green: "\e[32m",
145
- yellow: "\e[33m"
146
- }
147
147
  end
148
148
  end
@@ -1,3 +1,3 @@
1
1
  module Ididthis
2
- VERSION = "0.1.2.2"
2
+ VERSION = "0.1.3.pre"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ididthis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.2
4
+ version: 0.1.3.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Aikens
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-18 00:00:00.000000000 Z
11
+ date: 2015-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -206,6 +206,76 @@ dependencies:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0.4'
209
+ - !ruby/object:Gem::Dependency
210
+ name: guard
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '2.0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '2.0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: guard-rspec
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '4.0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '4.0'
237
+ - !ruby/object:Gem::Dependency
238
+ name: guard-rubocop
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: '1.0'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: '1.0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: terminal-notifier-guard
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ - !ruby/object:Gem::Dependency
266
+ name: libnotify
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - ">="
270
+ - !ruby/object:Gem::Version
271
+ version: '0'
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - ">="
277
+ - !ruby/object:Gem::Version
278
+ version: '0'
209
279
  description: A command line utility for posting and viewing dones on iDidThis.
210
280
  email:
211
281
  - paikens@gmail.com
@@ -225,6 +295,7 @@ files:
225
295
  - ".travis.yml"
226
296
  - CODE_OF_CONDUCT.md
227
297
  - Gemfile
298
+ - Guardfile
228
299
  - LICENSE.txt
229
300
  - README.md
230
301
  - Rakefile
@@ -250,12 +321,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
321
  version: 1.9.3
251
322
  required_rubygems_version: !ruby/object:Gem::Requirement
252
323
  requirements:
253
- - - ">="
324
+ - - ">"
254
325
  - !ruby/object:Gem::Version
255
- version: '0'
326
+ version: 1.3.1
256
327
  requirements: []
257
328
  rubyforge_project:
258
- rubygems_version: 2.4.6
329
+ rubygems_version: 2.4.8
259
330
  signing_key:
260
331
  specification_version: 4
261
332
  summary: Command line interface to iDoneThis using the API