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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ec789856e93bca0296c979ebe9aa8804f8bf626
4
- data.tar.gz: 1e06b16545b4de8f103a91cf96dfd98201a4dae3
3
+ metadata.gz: a47784cae27012512f8cfe22ca5cbdf335fbde4b
4
+ data.tar.gz: bcd6f5473cdb355967a04853baf664b29e9b4831
5
5
  SHA512:
6
- metadata.gz: 6558dfc895a016863d92f5bb63beac7336fef66fd67381286cc8ee6b046237a8f02d0fb62ad9821283a1d0e6302a67b7f0b9e1ac34b8cf88e05b9d7948786a6d
7
- data.tar.gz: a36c5fa17484f49661d2600f41b37fefeb3f9a95c53ad35af48e778933d39e64db25d6df4dff3524513761cac00092bd3983c2d7a78afc25606f7fe072610046
6
+ metadata.gz: 485f80de2dae72ed5fe10b738e9c2c9ba94c5a1035d092709c37c90cb65d3906772b8f0a1cdfa8224acea3d4078e9dbb5eacb275290e1e66000a8e90f3062001
7
+ data.tar.gz: f7bbcca7d6aee3dd00016c0bd52c1dae83813a0187b9df838cf5a5c2409c7b9789041b87bf4f2395778e5b770da212f2de460d7c9b1cf35b7c6bccf8ae656ef7
data/History.txt CHANGED
@@ -3,3 +3,5 @@
3
3
  2421f13574dd2ad78d6cc591e52b4261 pkg/user_space-0.0.0.gem
4
4
  === 0.1.0 / 2013-12-30 11:51:13 -0800
5
5
  c0014415ced058f3b79910f5c52bfe1e pkg/user_space-0.1.0.gem
6
+ === 0.2.0 / 2014-01-02 10:12:47 -0800
7
+ 1cd8d6d59f08ff03b32c895ee254ca14 pkg/user_space-0.2.0.gem
data/README.rdoc CHANGED
@@ -27,6 +27,8 @@ Automates certain XDG features.
27
27
  STDERR.puts "Writting '#{USERSPACE.config_file_name}'"
28
28
  USERSPACE.config = APP::CONFIG
29
29
  end
30
+ # To do the same thing, you can also say:
31
+ # USERSPACE.configures(APP::CONFIG)
30
32
 
31
33
  == FEATURES:
32
34
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module USER_SPACE
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
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.2.0', VERSION)
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.2.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-02'
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.1', '>= 1.1.4'
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.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]'
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.2.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-02 00:00:00.000000000 Z
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.1'
39
+ version: '1.99'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 1.1.4
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.1'
49
+ version: '1.99'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 1.1.4
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.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]'
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
@@ -1,12 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.rdoc
4
- TODO.txt
5
- data/VERSION
6
- features/main.feature
7
- features/step_definitions/main_steps.rb
8
- lib/user_space.rb
9
- lib/user_space/user_space.rb
10
- lib/user_space/version.rb
11
- test/user_space.rb
12
- user_space.gemspec