user_space 0.2.0 → 0.3.0
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 +4 -4
- data/History.txt +2 -0
- data/README.rdoc +2 -0
- data/lib/user_space/user_space.rb +9 -0
- data/lib/user_space/version.rb +1 -1
- data/test/user_space.rb +20 -1
- data/user_space.gemspec +4 -5
- metadata +7 -8
- data/Manifest.txt +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a47784cae27012512f8cfe22ca5cbdf335fbde4b
|
4
|
+
data.tar.gz: bcd6f5473cdb355967a04853baf664b29e9b4831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 485f80de2dae72ed5fe10b738e9c2c9ba94c5a1035d092709c37c90cb65d3906772b8f0a1cdfa8224acea3d4078e9dbb5eacb275290e1e66000a8e90f3062001
|
7
|
+
data.tar.gz: f7bbcca7d6aee3dd00016c0bd52c1dae83813a0187b9df838cf5a5c2409c7b9789041b87bf4f2395778e5b770da212f2de460d7c9b1cf35b7c6bccf8ae656ef7
|
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -101,6 +101,15 @@ module USER_SPACE
|
|
101
101
|
File.open(config_file_name, 'w', 0600){|fh| fh.puts options[:parser].pretty_generate obj}
|
102
102
|
end
|
103
103
|
|
104
|
+
def configures(hash, trace=nil)
|
105
|
+
if config? # file exists
|
106
|
+
config.each{|opt, value| hash[opt.to_sym] = value}
|
107
|
+
else
|
108
|
+
trace.puts config_file_name if trace
|
109
|
+
self.config = hash
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
104
113
|
def version?
|
105
114
|
File.exist?(version_file_name)
|
106
115
|
end
|
data/lib/user_space/version.rb
CHANGED
data/test/user_space.rb
CHANGED
@@ -18,7 +18,7 @@ class TestUserSpace < Test::Unit::TestCase
|
|
18
18
|
include USER_SPACE
|
19
19
|
|
20
20
|
def test_user_space_version
|
21
|
-
assert_equal('0.
|
21
|
+
assert_equal('0.3.0', VERSION)
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_user_space_constants
|
@@ -106,5 +106,24 @@ class TestUserSpace < Test::Unit::TestCase
|
|
106
106
|
assert userspace.version?
|
107
107
|
assert_nothing_raised(Exception){ userspace.version='Fantastico' }
|
108
108
|
assert_equal userspace.version, 'Fantastico'
|
109
|
+
|
110
|
+
# testing configures
|
111
|
+
config_file_name = userspace.config_file_name
|
112
|
+
File.unlink config_file_name if File.exist? config_file_name
|
113
|
+
config1 = {:a=>'A', :b=>'B'}
|
114
|
+
refute File.exist? config_file_name
|
115
|
+
userspace.configures(config1)
|
116
|
+
# Here, it copies to file.
|
117
|
+
assert File.exist? config_file_name
|
118
|
+
# And config1 remains unchanged.
|
119
|
+
assert_equal(config1[:a], 'A')
|
120
|
+
assert_equal(config1[:b], 'B')
|
121
|
+
assert_equal(config1[:c], nil)
|
122
|
+
config2 = {:a=>'AAA', :c=>'CCC'}
|
123
|
+
# Here, config2 is overwritten with config1 from file.
|
124
|
+
userspace.configures(config2)
|
125
|
+
assert_equal(config2[:a], 'A') # overwritten
|
126
|
+
assert_equal(config2[:b], 'B') # padded up
|
127
|
+
assert_equal(config2[:c], 'CCC') # Original value
|
109
128
|
end
|
110
129
|
end
|
data/user_space.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'user_space'
|
4
|
-
s.version = '0.
|
4
|
+
s.version = '0.3.0'
|
5
5
|
|
6
6
|
s.homepage = 'https://github.com/carlosjhr64/user_space'
|
7
7
|
|
8
8
|
s.author = 'CarlosJHR64'
|
9
9
|
s.email = 'carlosjhr64@gmail.com'
|
10
10
|
|
11
|
-
s.date = '2014-01-
|
11
|
+
s.date = '2014-01-16'
|
12
12
|
s.licenses = ['MIT']
|
13
13
|
|
14
14
|
s.description = <<DESCRIPTION
|
@@ -25,7 +25,6 @@ SUMMARY
|
|
25
25
|
s.require_paths = ["lib"]
|
26
26
|
s.files = %w(
|
27
27
|
History.txt
|
28
|
-
Manifest.txt
|
29
28
|
README.rdoc
|
30
29
|
TODO.txt
|
31
30
|
data/VERSION
|
@@ -39,8 +38,8 @@ user_space.gemspec
|
|
39
38
|
)
|
40
39
|
|
41
40
|
s.add_runtime_dependency 'xdg', '~> 2.2', '>= 2.2.3'
|
42
|
-
s.add_development_dependency 'rainbow', '~> 1.
|
41
|
+
s.add_development_dependency 'rainbow', '~> 1.99', '>= 1.99.1'
|
43
42
|
s.add_development_dependency 'test-unit', '~> 2.5', '>= 2.5.5'
|
44
|
-
s.requirements << 'ruby: ruby 2.
|
43
|
+
s.requirements << 'ruby: ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]'
|
45
44
|
|
46
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: user_space
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CarlosJHR64
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xdg
|
@@ -36,20 +36,20 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '1.
|
39
|
+
version: '1.99'
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 1.1
|
42
|
+
version: 1.99.1
|
43
43
|
type: :development
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '1.
|
49
|
+
version: '1.99'
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 1.1
|
52
|
+
version: 1.99.1
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: test-unit
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,7 +79,6 @@ extra_rdoc_files:
|
|
79
79
|
- README.rdoc
|
80
80
|
files:
|
81
81
|
- History.txt
|
82
|
-
- Manifest.txt
|
83
82
|
- README.rdoc
|
84
83
|
- TODO.txt
|
85
84
|
- data/VERSION
|
@@ -111,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
110
|
- !ruby/object:Gem::Version
|
112
111
|
version: '0'
|
113
112
|
requirements:
|
114
|
-
- 'ruby: ruby 2.
|
113
|
+
- 'ruby: ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]'
|
115
114
|
rubyforge_project:
|
116
115
|
rubygems_version: 2.2.0
|
117
116
|
signing_key:
|
data/Manifest.txt
DELETED