pomo 2.1.1 → 2.1.2

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.
@@ -1,4 +1,7 @@
1
1
  language: ruby
2
+ before_install:
3
+ - sudo apt-get update -qq
4
+ - sudo apt-get install -qq libnotify-dev
2
5
  rvm:
3
6
  - 2.0.0
4
7
  - 1.9.3
@@ -1,6 +1,14 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 2.1.2 / 2013-02-09
5
+ ==================
6
+
7
+ * Fixed default Break time. Closes #36
8
+
9
+ View [the full changelog][2.1.2].
10
+ [2.1.2]: https://github.com/visionmedia/pomo/compare/v2.1.1...v2.1.2
11
+
4
12
  2.1.1 / 2013-01-19
5
13
  ==================
6
14
 
@@ -15,7 +23,7 @@ View [the full changelog][2.1.1].
15
23
  * Added `pomo initconfig` to set up global preferences. Preferences
16
24
  can be overridden on the command-line (e.g. `pomo start --notifier
17
25
  growl`). Closes #30
18
- * Added multiple args to commands (e.g. `pomo rm 1..3 5..8`). Closes [#12]
26
+ * Added multiple args to commands (e.g. `pomo rm 1..3 5..8`). Closes #12
19
27
  * Added `pomo move` and `pomo copy`. Closes #18
20
28
  * Added RSpec specs and Cucumber features. Closes #9
21
29
 
data/Gemfile CHANGED
@@ -1,4 +1,13 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'rake'
4
+ gem 'yard'
5
+
6
+ group :test do
7
+ gem 'aruba', '~> 0.5.1'
8
+ gem 'rspec', '~> 2.12'
9
+ gem 'fakefs', '~> 0.4'
10
+ end
11
+
3
12
  # Specify your gem's dependencies in pomo.gemspec
4
13
  gemspec
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Pomo [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/visionmedia/pomo)
1
+ # Pomo [![Build Status](https://travis-ci.org/visionmedia/pomo.png?branch=master)](https://travis-ci.org/visionmedia/pomo) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/visionmedia/pomo)
2
2
 
3
3
  Command-line application for the [Pomodoro](http://www.pomodorotechnique.com/)
4
4
  time management technique, with notification and tmux status bar support.
@@ -141,10 +141,10 @@ Taken from `pomo help`:
141
141
 
142
142
  * View task details:
143
143
 
144
- $ pomo view first
145
- $ pomo view last
146
- $ pomo view 5
147
- $ pomo view 1 2 3
144
+ $ pomo show first
145
+ $ pomo show last
146
+ $ pomo show 5
147
+ $ pomo show 1 2 3
148
148
 
149
149
  * Remove all tasks:
150
150
 
@@ -199,11 +199,11 @@ and blue during a break e.g.
199
199
 
200
200
  We :heart: pull requests and feedback. Feel free to
201
201
  [submit a ticket](https://github.com/visionmedia/pomo/issues) or see
202
- [CONTRIBUTING](https://github.com/visionmedia/pomo/blob/master/CONTRIBUTING.md)
202
+ [CONTRIBUTING](CONTRIBUTING.md)
203
203
  for details on pull requests.
204
204
 
205
205
  ## Copyright
206
206
 
207
207
  Copyright (c) 2012 TJ Holowaychuk. See
208
- [LICENSE](https://github.com/visionmedia/pomo/blob/master/LICENSE.md)
208
+ [LICENSE](LICENSE.md)
209
209
  for details.
@@ -38,7 +38,7 @@ module Pomo
38
38
  # Load configuration file or default_options. Passed options take precedence.
39
39
 
40
40
  def self.load(options = {})
41
- options.reject!{|k,v| ![:notifier, :progress, :tmux].include? k}
41
+ user_options = options.reject{|k,v| ![:notifier, :progress, :tmux].include? k}
42
42
 
43
43
  if !(File.exists? config_file)
44
44
  File.open(config_file, 'w') { |file| YAML::dump(default_options, file) }
@@ -46,20 +46,18 @@ module Pomo
46
46
  end
47
47
 
48
48
  config_file_options = YAML.load_file(config_file)
49
- new(config_file_options.merge(options))
49
+ new(config_file_options.merge(user_options))
50
50
  end
51
51
 
52
52
  ##
53
53
  # Save configuration. Passed options take precendence over default_options.
54
54
 
55
55
  def self.save(options = {})
56
+ user_options = options.reject{|k,v| ![:notifier, :progress, :tmux].include? k}
56
57
  force_save = options.delete :force
57
- options.reject!{|k,v| ![:notifier, :progress, :tmux].include? k}
58
-
59
- options = default_options.merge(options)
60
58
 
61
59
  if !(File.exists? config_file) || force_save
62
- File.open(config_file, 'w') { |file| YAML::dump(options, file) }
60
+ File.open(config_file, 'w') { |file| YAML::dump(default_options.merge(user_options), file) }
63
61
  say "Initialized config file in #{config_file}"
64
62
  else
65
63
  say_error "Not overwriting existing config file #{config_file}, use --force to override. See 'pomo help initconfig'."
@@ -63,13 +63,10 @@ module Pomo
63
63
  ##
64
64
  # Import Github issue(s) with _user_, _project_, _number_ as GithubTask(s).
65
65
 
66
- def self.import(user, project, number)
66
+ def self.import(user, project, number=nil)
67
67
  tasks = []
68
- if number
69
- issues = [Octokit.issue({:username => user, :repo => project}, number)]
70
- else
71
- issues = Octokit.list_issues({:username => user, :repo => project}, :state => 'open', :sort => 'created')
72
- end
68
+
69
+ issues = get_issues(user, project, number)
73
70
 
74
71
  issues.each do |issue|
75
72
  tasks << new(issue.title,
@@ -81,7 +78,18 @@ module Pomo
81
78
  :url => issue.html_url
82
79
  )
83
80
  end
81
+
84
82
  return tasks
83
+ end
84
+
85
+ private
86
+
87
+ def self.get_issues(user, project, number)
88
+ if number
89
+ issues = [Octokit.issue({:username => user, :repo => project}, number)]
90
+ else
91
+ issues = Octokit.list_issues({:username => user, :repo => project}, :state => 'open', :sort => 'created')
92
+ end
85
93
  rescue Octokit::NotFound => e
86
94
  say "\n"
87
95
  say_error '404: This is not the repo you are looking for.'
@@ -46,32 +46,7 @@ module Pomo
46
46
  #
47
47
 
48
48
  def find(*args, &block)
49
- found = []
50
- found << tasks.first if args.empty?
51
-
52
- args.each do |arg|
53
- case arg
54
- when 'all'
55
- found = tasks
56
- break
57
- when 'first'
58
- found << tasks.first
59
- when 'last'
60
- found << tasks.last
61
- when 'complete'
62
- found.concat tasks.select { |task| task.complete? }
63
- when 'completed'
64
- found.concat tasks.select { |task| task.complete? }
65
- when 'incomplete'
66
- found.concat tasks.select { |task| not task.complete? }
67
- when /^(\d+)$/
68
- found << tasks[$1.to_i]
69
- when /^(\d+)\.\.(-?\d+)$/
70
- found.concat tasks[$1.to_i..$2.to_i]
71
- end
72
- end
73
-
74
- found.compact!
49
+ found = find_tasks(args)
75
50
 
76
51
  if block.arity == 2
77
52
  found.each_with_index do |task, i|
@@ -126,6 +101,33 @@ module Pomo
126
101
 
127
102
  private
128
103
 
104
+ def find_tasks(args)
105
+ found = []
106
+ found << tasks.first if args.empty?
107
+
108
+ args.each do |arg|
109
+ case arg
110
+ when 'all'
111
+ found = tasks
112
+ break
113
+ when 'first'
114
+ found << tasks.first
115
+ when 'last'
116
+ found << tasks.last
117
+ when 'complete', 'completed'
118
+ found.concat tasks.select { |task| task.complete? }
119
+ when 'incomplete'
120
+ found.concat tasks.select { |task| not task.complete? }
121
+ when /^(\d+)$/
122
+ found << tasks[$1.to_i]
123
+ when /^(\d+)\.\.(-?\d+)$/
124
+ found.concat tasks[$1.to_i..$2.to_i]
125
+ end
126
+ end
127
+
128
+ found.compact
129
+ end
130
+
129
131
  def index(arg)
130
132
  case arg
131
133
  when 'first'
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Pomo
3
- VERSION = '2.1.1'
3
+ VERSION = '2.1.2'
4
4
  end
@@ -19,16 +19,11 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
21
  spec.require_paths = ['lib']
22
- spec.rdoc_options = ['--line-numbers', '--inline-source', '--title', 'Pomo', '--main', 'Readme.md']
22
+ spec.rdoc_options = ['--line-numbers', '--inline-source', '--title', 'Pomo', '--main', 'README.md']
23
23
 
24
24
  spec.add_dependency('commander', '~> 4.1')
25
25
  spec.add_dependency('octokit', '~> 1.19')
26
26
  spec.add_dependency('terminal-notifier', '~> 1.4') if Pomo::OS.mac?
27
27
  spec.add_dependency('growl', '~> 1.0') if Pomo::OS.mac? || Pomo::OS.windows?
28
28
  spec.add_dependency('libnotify', '~> 0.8') if Pomo::OS.linux?
29
-
30
- spec.add_development_dependency('aruba', '~> 0.5.1')
31
- spec.add_development_dependency('rspec', '~> 2.12')
32
- spec.add_development_dependency('fakefs', '~> 0.4')
33
- spec.add_development_dependency('yard')
34
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pomo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-19 00:00:00.000000000 Z
13
+ date: 2013-02-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: commander
@@ -76,70 +76,6 @@ dependencies:
76
76
  - - ~>
77
77
  - !ruby/object:Gem::Version
78
78
  version: '1.0'
79
- - !ruby/object:Gem::Dependency
80
- name: aruba
81
- requirement: !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ~>
85
- - !ruby/object:Gem::Version
86
- version: 0.5.1
87
- type: :development
88
- prerelease: false
89
- version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
92
- - - ~>
93
- - !ruby/object:Gem::Version
94
- version: 0.5.1
95
- - !ruby/object:Gem::Dependency
96
- name: rspec
97
- requirement: !ruby/object:Gem::Requirement
98
- none: false
99
- requirements:
100
- - - ~>
101
- - !ruby/object:Gem::Version
102
- version: '2.12'
103
- type: :development
104
- prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
108
- - - ~>
109
- - !ruby/object:Gem::Version
110
- version: '2.12'
111
- - !ruby/object:Gem::Dependency
112
- name: fakefs
113
- requirement: !ruby/object:Gem::Requirement
114
- none: false
115
- requirements:
116
- - - ~>
117
- - !ruby/object:Gem::Version
118
- version: '0.4'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
- requirements:
124
- - - ~>
125
- - !ruby/object:Gem::Version
126
- version: '0.4'
127
- - !ruby/object:Gem::Dependency
128
- name: yard
129
- requirement: !ruby/object:Gem::Requirement
130
- none: false
131
- requirements:
132
- - - ! '>='
133
- - !ruby/object:Gem::Version
134
- version: '0'
135
- type: :development
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
- requirements:
140
- - - ! '>='
141
- - !ruby/object:Gem::Version
142
- version: '0'
143
79
  description: Pomodoro time management for the command-line
144
80
  email:
145
81
  - tj@vision-media.ca
@@ -191,7 +127,7 @@ rdoc_options:
191
127
  - --title
192
128
  - Pomo
193
129
  - --main
194
- - Readme.md
130
+ - README.md
195
131
  require_paths:
196
132
  - lib
197
133
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -211,7 +147,7 @@ rubyforge_project: pomo
211
147
  rubygems_version: 1.8.23
212
148
  signing_key:
213
149
  specification_version: 3
214
- summary: pomo-2.1.1
150
+ summary: pomo-2.1.2
215
151
  test_files:
216
152
  - features/configuration.feature
217
153
  - features/manage_list.feature