asgit 0.0.2 → 0.0.3

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: 2a3ef352b417a8256bb2ebd10497bcc8c75204ba
4
- data.tar.gz: 171ef7978ea71218aa65d57ee60a044014079217
3
+ metadata.gz: 2f65ffd8d253ea3d44fe78e58222c82634b21478
4
+ data.tar.gz: 79d2e45d7d8c0fcda2b7dcbb058e0d68a39c80be
5
5
  SHA512:
6
- metadata.gz: b54bbbd61edbe4f8c67ef66c6e79f180c09c65bdfc6ea142a3dd28608c4e45be493697b7d7422dfea8c1de764656ccb79c2c2adeb9a3fc55fe93e966f69cc10c
7
- data.tar.gz: 610f6e59d1f2fc4a1c437b37e806317138027093f9a09365ceb771889064a1452737cbb729f07a4455b8a4adc05144c4616a1d7f30c5b529c89bfbce48c2adc6
6
+ metadata.gz: 806b184a313a4eab9ca590693537b4e0c33cba0a521d160d3a55a3b95724278b7b2ff8c63c7cb31571e3c9366fe08ec9dce41d02371532edb063bcc291a26746
7
+ data.tar.gz: 3e00a8879e1155ee895d8b3c02db0130c40eadf8cece5ae0d11734c339b46c92fd144067aa0de51f84d99f1a35932840eee16f2e1e137802897525f0dd10f8de
data/lib/asgit/config.rb CHANGED
@@ -1,13 +1,15 @@
1
1
  module Asgit
2
2
  class Config
3
+
4
+ attr_reader :service
3
5
  attr_accessor :organization, :project
4
6
 
5
- def service
6
- @_service
7
+ def service= name
8
+ @service = Asgit::Services.send(name.to_sym)
7
9
  end
8
10
 
9
- def service= name
10
- @_service = Asgit::Services.send(name.to_sym)
11
+ def attributes
12
+ [ :service, :organization, :project ]
11
13
  end
12
14
 
13
15
  end
@@ -20,5 +22,13 @@ module Asgit
20
22
  def config
21
23
  @_config ||= Config.new
22
24
  end
25
+
26
+ def configured?
27
+ config.attributes.each do |attr|
28
+ return false unless config.send(attr)
29
+ end
30
+
31
+ true
32
+ end
23
33
  end
24
34
  end
data/lib/asgit/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Asgit
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -34,4 +34,28 @@ describe Asgit::Config do
34
34
  end
35
35
  end
36
36
 
37
+ describe "::configured?" do
38
+ it "returns false if configuration hasn't been set" do
39
+ expect( Asgit.configured? ).to be_false
40
+ end
41
+
42
+ it "returns false if config is partially set" do
43
+ Asgit.configure do |c|
44
+ c.project = 'foo'
45
+ end
46
+
47
+ expect( Asgit.configured? ).to be_false
48
+ end
49
+
50
+ it "returns true if configuration has been set" do
51
+ Asgit.configure do |c|
52
+ c.project = 'foo'
53
+ c.organization = 'bar'
54
+ c.service = :github
55
+ end
56
+
57
+ expect( Asgit.configured? ).to be_true
58
+ end
59
+ end
60
+
37
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asgit
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
  - Steven Sloan