spinna 0.0.2 → 0.0.3

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: 00e1136dcfb00747d5be9846956575382fb00892
4
- data.tar.gz: c2a0680d7623897bbde5ee57dcfcd8639d87df1b
3
+ metadata.gz: 0db8fb458a101ffcb7deebae97f3c721aae130ad
4
+ data.tar.gz: 6d9b9b2daf0069039b511e80f5b68ba3f665b927
5
5
  SHA512:
6
- metadata.gz: d9d735075b974c50d9a5d9fdfedac6786d0caf2361ef812b6ee838c404e250f680efc96a28e8e791eba30441915a9fcdf481f01f93b4ea0903934c8cfb012498
7
- data.tar.gz: 65b7489e861410157bb422cb84a06725bace93eb85939b37b89f5a899304b0100425b311d893ffa8f368f882a1866e4c89a52c754d4f6ada11a5b6ac176628d0
6
+ metadata.gz: 19b8427129a40acb143947a212498a8e8194880bc8ee99046f21244f09c9df61c8318640a94cda5fc97c885c46ae0524b89cf2667fc4242c1d06af93d40874b3
7
+ data.tar.gz: 561ab20d83b2797b94799c22a7f367348b682a4a3712499ed652155e5029fbdff166ba5222da4fdcbe1ad2b9061966d2ca2fc521069e2e013e557cbcbc908fbe
data/.travis.yml CHANGED
@@ -2,7 +2,15 @@ language: ruby
2
2
  rvm:
3
3
  - "1.9.2"
4
4
  - "1.9.3"
5
+ - "2.1.0"
5
6
  - "2.1.1"
7
+ - "2.1.2"
8
+ - "2.1.3"
9
+ - "2.1.4"
10
+ - "2.1.5"
11
+ - "2.2.0"
12
+ - "2.2.1"
13
+ - "2.2.2"
6
14
  - jruby-19mode # JRuby in 1.9 mode
7
15
 
8
16
  script: bundle exec rake test
data/CHANGELOG.md CHANGED
@@ -1,6 +1,21 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## 0.0.3 - 2015-07-06
5
+
6
+ ### Added
7
+ - Nothing
8
+
9
+ ### Deprecated
10
+ - Nothing.
11
+
12
+ ### Removed
13
+ - Nothing.
14
+
15
+ ### Fixed
16
+ - Move the location of the executable to exe/ as it is
17
+ the new convention.
18
+
4
19
  ## 0.0.2 - 2014-08-02
5
20
 
6
21
  ### Added
data/Gemfile CHANGED
@@ -2,4 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in spinna.gemspec
4
4
  gemspec
5
-
data/{bin → exe}/spinna RENAMED
File without changes
data/lib/spinna.rb CHANGED
@@ -2,15 +2,14 @@ require "spinna/version"
2
2
 
3
3
  module Spinna
4
4
  # Base class for all errors.
5
- class Error < StandardError; end
5
+ Error = Class.new(StandardError)
6
6
 
7
7
  # Raised when the configuration file was not found.
8
- class ConfigFileNotFoundError < Error; end
8
+ ConfigFileNotFoundError = Class.new(Error)
9
9
 
10
10
  # Raised when the configuration file is not valid.
11
- class InvalidConfigFileError < Error; end
11
+ InvalidConfigFileError = Class.new(Error)
12
12
 
13
13
  # Raised when the source_dir does not exist.
14
- class InvalidSourceDirError < Error; end
14
+ InvalidSourceDirError = Class.new(Error)
15
15
  end
16
-
data/lib/spinna/cli.rb CHANGED
@@ -21,4 +21,3 @@ module Spinna
21
21
  end
22
22
  end
23
23
  end
24
-
data/lib/spinna/client.rb CHANGED
@@ -42,4 +42,3 @@ module Spinna
42
42
  end
43
43
  end
44
44
  end
45
-
data/lib/spinna/config.rb CHANGED
@@ -87,4 +87,3 @@ module Spinna
87
87
  end
88
88
  end
89
89
  end
90
-
@@ -74,4 +74,3 @@ module Spinna
74
74
  end
75
75
  end
76
76
  end
77
-
@@ -34,4 +34,3 @@ module Spinna
34
34
  end
35
35
  end
36
36
  end
37
-
data/lib/spinna/picker.rb CHANGED
@@ -50,4 +50,3 @@ module Spinna
50
50
  end
51
51
  end
52
52
  end
53
-
@@ -1,4 +1,3 @@
1
1
  module Spinna
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
4
-
File without changes
@@ -0,0 +1,3 @@
1
+ source_dir: '/tmp'
2
+ history_size: 10
3
+ number_of_picks: 5
@@ -18,7 +18,7 @@ describe 'spinna get' do
18
18
 
19
19
  context 'when used without any options' do
20
20
  before do
21
- Open3.popen3("#{@wd}/bin/spinna get") do |stdin, stdout, stderr, wait_thr|
21
+ Open3.popen3("#{@wd}/exe/spinna get") do |stdin, stdout, stderr, wait_thr|
22
22
  @stdout = stdout.read
23
23
  @stderr = stderr.read
24
24
  @exit_status = wait_thr.value
@@ -44,7 +44,7 @@ describe 'spinna get' do
44
44
 
45
45
  context 'when given a -n (--number_of_picks) option' do
46
46
  before do
47
- Open3.popen3("#{@wd}/bin/spinna get -n 3") do |stdin, stdout, stderr, wait_thr|
47
+ Open3.popen3("#{@wd}/exe/spinna get -n 3") do |stdin, stdout, stderr, wait_thr|
48
48
  @stdout = stdout.read
49
49
  @stderr = stderr.read
50
50
  @exit_status = wait_thr.value
@@ -70,7 +70,7 @@ describe 'spinna get' do
70
70
 
71
71
  context 'when given a -p (--pattern) option' do
72
72
  before do
73
- Open3.popen3("#{@wd}/bin/spinna get -p \"album 1\" -n 1") do |stdin, stdout, stderr, wait_thr|
73
+ Open3.popen3("#{@wd}/exe/spinna get -p \"album 1\" -n 1") do |stdin, stdout, stderr, wait_thr|
74
74
  @stdout = stdout.read
75
75
  @stderr = stderr.read
76
76
  @exit_status = wait_thr.value
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,13 @@
1
+ # Code coverage
2
+ require 'simplecov'
3
+ require 'coveralls'
4
+
5
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
6
+ SimpleCov::Formatter::HTMLFormatter,
7
+ Coveralls::SimpleCov::Formatter
8
+ ]
9
+ SimpleCov.start
10
+
1
11
  require 'minitest/autorun'
2
12
  require 'minitest/spec'
3
13
  require 'minitest/pride'
@@ -17,6 +17,7 @@ describe Spinna::Config do
17
17
  describe '#new' do
18
18
  let(:data_dir) { File.expand_path("../../fixtures/data_dir", __FILE__) }
19
19
  let(:non_existing_data_dir) { File.join(Dir.home, '.nonexisting') }
20
+ let(:data_dir_without_config) { File.expand_path("../../fixtures/data_dir_without_config", __FILE__) }
20
21
 
21
22
  context 'when the data_dir does not exist' do
22
23
  let(:opts) { {:data_dir => non_existing_data_dir} }
@@ -28,7 +29,7 @@ describe Spinna::Config do
28
29
  end
29
30
 
30
31
  context 'when the configuration file does not exist' do
31
- let(:opts) { {:data_dir => non_existing_data_dir} }
32
+ let(:opts) { {:data_dir => data_dir_without_config} }
32
33
 
33
34
  subject do
34
35
  Spinna::Config.new(opts)
@@ -4,8 +4,9 @@ require 'spinna/config'
4
4
 
5
5
  describe Spinna::History do
6
6
  let(:data_dir) { File.expand_path("../../fixtures/data_dir", __FILE__) }
7
+ let(:data_dir_without_history) { File.expand_path("../../fixtures/data_dir_without_history", __FILE__) }
7
8
  let(:opts) { {:data_dir => data_dir} }
8
- let(:config) { stub(:data_dir => data_dir, :history_size => 10 ) }
9
+ let(:config) { stub(:data_dir => data_dir, :history_size => 10) }
9
10
  let(:history_size) { 3 }
10
11
 
11
12
  describe '#new' do
@@ -15,8 +16,25 @@ describe Spinna::History do
15
16
  subject.config.must_equal config
16
17
  end
17
18
 
18
- it 'reads the history log from the filesystem' do
19
- subject.log.size.must_equal history_size
19
+ context 'when the history log file exists' do
20
+ it 'reads the history log from the filesystem' do
21
+ subject.log.size.must_equal history_size
22
+ end
23
+ end
24
+
25
+ context 'when the history log does not exist' do
26
+ let(:config) { stub(:data_dir => data_dir_without_history, :history_size => 10) }
27
+
28
+ subject { Spinna::History.new(config) }
29
+
30
+ it 'does not read the history log from the filesystem' do
31
+ File.expects(:read).never
32
+ subject
33
+ end
34
+
35
+ it 'inits the log as an empty array' do
36
+ subject.log.size.must_equal 0
37
+ end
20
38
  end
21
39
  end
22
40
 
data/spinna.gemspec CHANGED
@@ -9,22 +9,24 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Patrick Paul-Hus"]
10
10
  spec.email = ["hydrozen@gmail.com"]
11
11
  spec.summary = %q{Randomly picks albums from your music library so you don’t have to.}
12
- spec.description = ""
12
+ spec.description = "Picks albums from your music collection so you don’t have to."
13
13
  spec.homepage = "https://github.com/hydrozen/spinna"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
18
  spec.require_paths = ["lib"]
20
19
 
21
- spec.add_development_dependency "bundler", "~> 1.6"
20
+ spec.add_development_dependency "bundler", "~> 1.8"
22
21
  spec.add_development_dependency "rake", "~> 10.0"
23
22
  spec.add_development_dependency "minitest", "~> 5.3"
24
23
  spec.add_development_dependency "minitest-spec-context", "~> 0.0"
25
24
  spec.add_development_dependency "pry", "~> 0.10"
26
25
  spec.add_development_dependency "mocha", "~> 1.1"
27
26
  spec.add_development_dependency "minitest-reporters", "~> 1.0"
27
+ spec.add_development_dependency "coveralls", "~> 0.8.2"
28
+ spec.add_development_dependency "simplecov", "~> 0.10.0"
28
29
 
29
30
  spec.add_runtime_dependency "thor", "~> 0.19"
30
31
  end
32
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spinna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Paul-Hus
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-02 00:00:00.000000000 Z
11
+ date: 2015-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.6'
19
+ version: '1.8'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.6'
26
+ version: '1.8'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,34 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: coveralls
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.8.2
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.8.2
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.10.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.10.0
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: thor
113
141
  requirement: !ruby/object:Gem::Requirement
@@ -122,11 +150,10 @@ dependencies:
122
150
  - - "~>"
123
151
  - !ruby/object:Gem::Version
124
152
  version: '0.19'
125
- description: ''
153
+ description: Picks albums from your music collection so you don’t have to.
126
154
  email:
127
155
  - hydrozen@gmail.com
128
- executables:
129
- - spinna
156
+ executables: []
130
157
  extensions: []
131
158
  extra_rdoc_files: []
132
159
  files:
@@ -137,7 +164,7 @@ files:
137
164
  - LICENSE.txt
138
165
  - README.md
139
166
  - Rakefile
140
- - bin/spinna
167
+ - exe/spinna
141
168
  - lib/spinna.rb
142
169
  - lib/spinna/cli.rb
143
170
  - lib/spinna/client.rb
@@ -152,6 +179,8 @@ files:
152
179
  - spec/fixtures/data_dir/config3.yml
153
180
  - spec/fixtures/data_dir/config4.yml
154
181
  - spec/fixtures/data_dir/history.log
182
+ - spec/fixtures/data_dir_without_config/.gitkeep
183
+ - spec/fixtures/data_dir_without_history/config.yml
155
184
  - spec/fixtures/source_dir/album1/.gitkeep
156
185
  - spec/fixtures/source_dir/album2/.gitkeep
157
186
  - spec/fixtures/source_dir/album3/.gitkeep
@@ -183,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
212
  version: '0'
184
213
  requirements: []
185
214
  rubyforge_project:
186
- rubygems_version: 2.2.2
215
+ rubygems_version: 2.4.5
187
216
  signing_key:
188
217
  specification_version: 4
189
218
  summary: Randomly picks albums from your music library so you don’t have to.
@@ -194,6 +223,8 @@ test_files:
194
223
  - spec/fixtures/data_dir/config3.yml
195
224
  - spec/fixtures/data_dir/config4.yml
196
225
  - spec/fixtures/data_dir/history.log
226
+ - spec/fixtures/data_dir_without_config/.gitkeep
227
+ - spec/fixtures/data_dir_without_history/config.yml
197
228
  - spec/fixtures/source_dir/album1/.gitkeep
198
229
  - spec/fixtures/source_dir/album2/.gitkeep
199
230
  - spec/fixtures/source_dir/album3/.gitkeep
@@ -204,4 +235,3 @@ test_files:
204
235
  - spec/unit/history_spec.rb
205
236
  - spec/unit/music_library_spec.rb
206
237
  - spec/unit/picker_spec.rb
207
- has_rdoc: