brewer 0.0.24 → 0.0.30

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: c59e6ed5a2631055e58561388cd0281981d8b2e6
4
- data.tar.gz: cb7a25668057a798c748c24772cfa801e5ed5cd3
3
+ metadata.gz: 9fa294ebd0343287938b6222e37a6e6db70c9660
4
+ data.tar.gz: 192316507e0254b4e0d7f6de91f30671918be3ff
5
5
  SHA512:
6
- metadata.gz: b3b4cb3d456e0acb045e02b9c342d041cbc8e6a683ae72e304c912fa7b6a129134b7e2bac1f7d20f54a59333356b89a8e7ee58e4c85600198dca7785d12cfcaf
7
- data.tar.gz: 266b36dea35b67b9aeb866ebd8a668a00bf9e18b9ef053f6a29909e12afb6c1d8b6c7860d3bcb7a5e48f8f8cd4abb97a34f172fb5be7afafd43e9630e957da2b
6
+ metadata.gz: 9d217c70265cb95b9347f46031c66973109045f01e45454b48787f6a3df0c64b21d59aa0d64e97651372d64104f8d9d5c1e92bbae0259374fff3bdbdabc86757
7
+ data.tar.gz: 8c8bb9d393097e6268ac3af51ad54252e77252838777f527c61494ea01a4ce795f04846c1dbe4539970ff998a8483d46e819f9d255ba167fe5e2561d2202974f
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brewer (0.0.23)
4
+ brewer (0.0.24)
5
5
  git (~> 1.3, >= 1.3.0)
6
- net-ping (~> 1.7.0)
6
+ net-ping (~> 1.7)
7
7
  ripl (~> 0.7.0)
8
8
 
9
9
  GEM
data/README.md CHANGED
@@ -1,24 +1,35 @@
1
- # Ruby Brewer
2
- ### A Ruby API for adaptiman/adaptibrew
1
+ # Brewer [![Build Status](https://travis-ci.org/llamicron/brewer.svg?branch=master)](https://travis-ci.org/llamicron/brewer)
2
+ ### A Ruby gem for [adaptiman/adaptibrew](http://github.com/adaptiman/adaptibrew)
3
3
 
4
4
  # Disclaimer
5
- This is just an API to make adaptibrew more user friendly. It will provide a clean shell and easy to understand methods for all the actions you need to control your brew rig. This will require an actual brew rig and all the equipment listed in [adaptiman/adaptibrew](https://github.com/adaptiman/adaptibrew). If you are looking to build an automated brew rig, **this is not the place to start**. Head over to [adaptiman/adaptibrew](https://github.com/adaptiman/adaptibrew), or hit up [adaptiman](https://github.com/adaptiman).
5
+ This is just a gem to make adaptibrew more user friendly. It will provide a clean shell and easy to understand methods for all the actions you need to control your brew rig with continuity.
6
+
7
+ This will require an actual brew rig and all the equipment listed in [adaptiman/adaptibrew](https://github.com/adaptiman/adaptibrew)'s readme. If you are looking to build an automated brew rig, **this is not the place to start**. Head over to [adaptiman/adaptibrew](https://github.com/adaptiman/adaptibrew), or hit up [adaptiman](https://github.com/adaptiman).
6
8
 
7
9
  # Installation
8
- This package is a weird half-breed Frankenstein's monster type of thing. You can install it as a gem with
10
+ This is a gem, published on [rubygems.org](http://rubygems.org). Install it the recommended way with:
9
11
  ```shell
10
12
  gem install brewer
11
13
  ```
12
- and `require 'brewer'` in your ruby code, or run
14
+ This will be the latest stable release.
15
+ **Or** you can put the following line in a `Gemfile`;
16
+ ```ruby
17
+ gem 'brewer'
18
+ ```
19
+ and run `bundle install`.
20
+
21
+ You may also download a .gem file from the releases section and install it that way, or further still build a new .gem file from the `brewer.gemspec` if you want the latest possible release. Keep in mind this may not be stable.
22
+
23
+ After installation, run
13
24
  ```shell
14
25
  brewer
15
26
  ```
16
- to open an interactive shell to control your brew rig in realtime. Fancy.
27
+ to open an interactive shell to control your brew rig in realtime.Just like any other gem, you can `require 'brewer'` from another ruby project.
17
28
 
18
29
  # Documentation
19
30
  **Warning: RDoc may have a seizure when encountering Gemfiles, Rakefiles, etc. Basically files that don't end in `.rb` but have ruby syntax. Docs will be a bit weird on those files. I suggest just reading the comments in source.**
20
31
  Documentation is in `doc/` or on rubygems.org
21
32
 
33
+ ---
22
34
 
23
-
24
- for build triggers, please ignore
35
+ *This line is for CI build triggers, please ignore*
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ task default: %w[spec]
7
7
 
8
8
  # Unit testing
9
9
  # You can specify a specific test case to use
10
- # Ex: rake test['brewer']
10
+ # rake spec SPEC=spec/adaptibrew_spec.rb SPEC_OPTS="-e \"#new\""
11
11
  task :spec, [:tc] do |t, tc|
12
12
  RSpec::Core::RakeTask.new(:spec)
13
13
  end
@@ -2,7 +2,7 @@ require 'rake'
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "brewer"
5
- s.version = "0.0.24"
5
+ s.version = "0.0.30"
6
6
  s.default_executable = "brewer"
7
7
 
8
8
  s.authors = ["Luke Sweeney"]
@@ -37,4 +37,11 @@ class Adaptibrew
37
37
  self
38
38
  end
39
39
 
40
+ def present?
41
+ if Dir.exists?('adaptibrew')
42
+ return true
43
+ end
44
+ false
45
+ end
46
+
40
47
  end
@@ -31,7 +31,6 @@ class Brewer
31
31
 
32
32
  # Clears the @out array
33
33
  # Writes current @out to log
34
- # This is why the prod log is changed when tests are run
35
34
  def clear
36
35
  write_log(@log, @out)
37
36
  @out = []
@@ -7,64 +7,86 @@ describe Adaptibrew do
7
7
  end
8
8
 
9
9
  describe "#new" do
10
- specify { expect(@adaptibrew).to be_an_instance_of Adaptibrew }
10
+ specify { expect(Adaptibrew.new).to be_an_instance_of Adaptibrew }
11
11
  end
12
12
 
13
13
  describe ".clear" do
14
14
  context "when the repo already exists" do
15
- specify { expect(Dir.exists?('adaptibrew')).to be true }
15
+ let(:adaptibrew) { Adaptibrew.new }
16
+ specify { expect(adaptibrew.present?).to be true }
16
17
 
17
18
  it "deletes the repo" do
18
19
  @adaptibrew.clear
19
- expect(Dir.exists?('adaptibrew')).to be false
20
+ expect(@adaptibrew.present?).to be false
20
21
  end
21
22
  end
22
23
 
23
24
  context "when the repo does not exist" do
24
25
  let(:adaptibrew) { Adaptibrew.new }
25
26
  before { adaptibrew.clear }
26
- specify { expect(Dir.exists?('adaptibrew')).to be false }
27
+ specify { expect(adaptibrew.present?).to be false }
27
28
 
28
29
  it "does nothing" do
29
30
  @adaptibrew.clear
30
- expect(Dir.exists?('adaptibrew')).to be false
31
+ expect(@adaptibrew.present?).to be false
31
32
  end
32
33
  end
33
-
34
34
  end
35
35
 
36
36
  describe ".clone" do
37
37
  context "when the repo does not exist" do
38
38
  let(:adaptibrew) { Adaptibrew.new }
39
39
  before { adaptibrew.clear }
40
- specify { expect(Dir.exists?('adaptibrew')).to be false }
40
+ specify { expect(adaptibrew.present?).to be false }
41
41
 
42
42
  it "clones the repo" do
43
43
  @adaptibrew.clone
44
- expect(Dir.exists?('adaptibrew')).to be true
44
+ expect(@adaptibrew.present?).to be true
45
45
  end
46
46
  end
47
47
 
48
48
  context "when the repo exists" do
49
49
  let(:adaptibrew) { Adaptibrew.new }
50
50
  before { adaptibrew.clone }
51
- specify { expect(Dir.exists?('adaptibrew')).to be true }
51
+ specify { expect(adaptibrew.present?).to be true }
52
52
 
53
53
  it "does nothing" do
54
54
  @adaptibrew.clone
55
- expect(Dir.exists?('adaptibrew')).to be true
55
+ expect(@adaptibrew.present?).to be true
56
56
  end
57
57
  end
58
-
59
58
  end
60
59
 
61
60
  describe ".refresh" do
62
61
  let(:adaptibrew) { Adaptibrew.new }
63
62
  before { adaptibrew.refresh }
63
+
64
64
  it "clears and clones the repo" do # regardless of wether or not it's there
65
- expect(Dir.exists?('adaptibrew')).to be true
65
+ expect(@adaptibrew.present?).to be true
66
66
  @adaptibrew.refresh
67
- expect(Dir.exists?('adaptibrew')).to be true
67
+ expect(@adaptibrew.present?).to be true
68
+ end
69
+
70
+ end
71
+
72
+ describe ".present?" do
73
+ context "when the repo is present" do
74
+ let(:adaptibrew) { Adaptibrew.new }
75
+ before { adaptibrew.refresh }
76
+ specify { expect(Dir.exists?('adaptibrew')).to be true }
77
+
78
+ it "returns true" do
79
+ expect(@adaptibrew.present?).to be true
80
+ end
81
+ end
82
+
83
+ context "when the repo is not present" do
84
+ let(:adaptibrew) { Adaptibrew.new }
85
+ before { adaptibrew.clear }
86
+ specify { expect(Dir.exists?('adaptibrew')).to be false }
87
+ it "returns false" do
88
+ expect(@adaptibrew.present?).to be false
89
+ end
68
90
  end
69
91
  end
70
92
 
@@ -8,7 +8,10 @@ describe Brewer do
8
8
 
9
9
  describe "#new" do
10
10
  it "returns a brewer object" do
11
- expect(@brewer).to be_an_instance_of Brewer
11
+ expect(Brewer.new).to be_an_instance_of Brewer
12
+ end
13
+ it "does not accept args" do
14
+ expect { Brewer.new('heres an arg') }.to raise_exception(ArgumentError)
12
15
  end
13
16
  end
14
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Sweeney