breadboard 1.1.0.rc1 → 1.1.0.rc2
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.
- data/CHANGELOG +2 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/features/step_definitions/configure_steps.rb +1 -0
- data/lib/breadboard/env_config.rb +16 -9
- data/readme.md +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.0.
|
1
|
+
1.1.0.rc2
|
@@ -2,25 +2,32 @@ module Breadboard
|
|
2
2
|
module Config
|
3
3
|
# holds site, user, password values for an environment instance
|
4
4
|
class EnvConfig
|
5
|
-
def
|
6
|
-
@
|
5
|
+
def site(url=nil)
|
6
|
+
return @site unless url
|
7
|
+
|
8
|
+
if url.kind_of?(URI)
|
9
|
+
@site = url
|
10
|
+
else
|
11
|
+
@site = URI.parse url
|
12
|
+
end
|
7
13
|
end
|
8
14
|
|
9
|
-
def
|
10
|
-
@
|
15
|
+
def user(username=nil)
|
16
|
+
return @user unless username
|
17
|
+
@user = username
|
11
18
|
end
|
12
19
|
|
13
|
-
def
|
14
|
-
return @
|
15
|
-
@
|
20
|
+
def password(pass=nil)
|
21
|
+
return @password unless pass
|
22
|
+
@password = pass
|
16
23
|
end
|
17
24
|
|
18
25
|
def to_s
|
19
|
-
@
|
26
|
+
@site.to_s
|
20
27
|
end
|
21
28
|
|
22
29
|
def empty?
|
23
|
-
|
30
|
+
!(site || password || user)
|
24
31
|
end
|
25
32
|
end
|
26
33
|
end
|
data/readme.md
CHANGED
@@ -76,7 +76,7 @@ Now suppose you have a 'Book' model that needs to connect to a different service
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
-
If you need to set user and password for a restful service, you can do so with a block
|
79
|
+
If you need to set user and password for a restful service, you can do so with a block (as of version 1.1.0.rc1)
|
80
80
|
|
81
81
|
Breadboard.configure do
|
82
82
|
model Book do
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: breadboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15424033
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
9
|
- 0
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 1.1.0.
|
11
|
+
- 2
|
12
|
+
version: 1.1.0.rc2
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Matt Parker
|