user_space 0.1.0 → 0.2.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: 075f899538258ccb2ded46959080f9cf742ef108
4
- data.tar.gz: 58a8355ec025fdfb17ecb0056fc009f42dfc9280
3
+ metadata.gz: 3ec789856e93bca0296c979ebe9aa8804f8bf626
4
+ data.tar.gz: 1e06b16545b4de8f103a91cf96dfd98201a4dae3
5
5
  SHA512:
6
- metadata.gz: 54fcd9fc4ac63c979d2a13cbdffbc6b503cce180a036ff8b3e07050883e95c5d2c55fe07e67ae76eccfd2466e3c73ecf28529897b831c6610aab88e9c5ff2373
7
- data.tar.gz: eb76f11215c7233334766f48999f0a561ad573a482a94e7f563e441c43df3450f056befb307355122dd3f634bdb774970ad335958835eba4e303d2a566e15dce
6
+ metadata.gz: 6558dfc895a016863d92f5bb63beac7336fef66fd67381286cc8ee6b046237a8f02d0fb62ad9821283a1d0e6302a67b7f0b9e1ac34b8cf88e05b9d7948786a6d
7
+ data.tar.gz: a36c5fa17484f49661d2600f41b37fefeb3f9a95c53ad35af48e778933d39e64db25d6df4dff3524513761cac00092bd3983c2d7a78afc25606f7fe072610046
@@ -1,3 +1,5 @@
1
1
  === 0.0.0 / 2013-12-21 09:33:10 -0800
2
2
  === 0.0.0 / 2013-12-22 15:18:15 -0800
3
3
  2421f13574dd2ad78d6cc591e52b4261 pkg/user_space-0.0.0.gem
4
+ === 0.1.0 / 2013-12-30 11:51:13 -0800
5
+ c0014415ced058f3b79910f5c52bfe1e pkg/user_space-0.1.0.gem
@@ -10,6 +10,7 @@ module USER_SPACE
10
10
  :appdir => nil, # Can't guess at this point yet?
11
11
  :xdgbases => ['CACHE', 'CONFIG', 'DATA']}
12
12
 
13
+ attr_accessor :trace, :verbose
13
14
  attr_reader :appname, :appdir, :xdgbases, :options
14
15
  def initialize(parameters=PARAMETERS)
15
16
 
@@ -89,6 +90,10 @@ module USER_SPACE
89
90
  # Reads config
90
91
  def config(options=@options)
91
92
  options[:parser].parse File.read(config_file_name(options))
93
+ rescue
94
+ trace.puts $!.message if trace
95
+ vebose.puts $!.backtrace if verbose
96
+ nil
92
97
  end
93
98
 
94
99
  # Saves config
@@ -96,12 +101,21 @@ module USER_SPACE
96
101
  File.open(config_file_name, 'w', 0600){|fh| fh.puts options[:parser].pretty_generate obj}
97
102
  end
98
103
 
104
+ def version?
105
+ File.exist?(version_file_name)
106
+ end
107
+
99
108
  # This reads the data directory's version file
100
109
  def version
101
- fn = version_file_name
102
- return nil unless File.exist? fn
103
110
  File.read(version_file_name).strip
111
+ rescue
112
+ trace.puts $!.message if trace
113
+ vebose.puts $!.backtrace if verbose
114
+ nil
104
115
  end
105
116
 
117
+ def version=(v)
118
+ File.open(version_file_name, 'w', 0600){|fh| fh.puts v}
119
+ end
106
120
  end
107
121
  end
@@ -1,3 +1,3 @@
1
1
  module USER_SPACE
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -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.1.0', VERSION)
21
+ assert_equal('0.2.0', VERSION)
22
22
  end
23
23
 
24
24
  def test_user_space_constants
@@ -103,5 +103,8 @@ class TestUserSpace < Test::Unit::TestCase
103
103
  assert_equal stat.mode.to_s(8), '40700'
104
104
  end
105
105
 
106
+ assert userspace.version?
107
+ assert_nothing_raised(Exception){ userspace.version='Fantastico' }
108
+ assert_equal userspace.version, 'Fantastico'
106
109
  end
107
110
  end
@@ -1,14 +1,14 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'user_space'
4
- s.version = '0.1.0'
4
+ s.version = '0.2.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 = '2013-12-30'
11
+ s.date = '2014-01-02'
12
12
  s.licenses = ['MIT']
13
13
 
14
14
  s.description = <<DESCRIPTION
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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - CarlosJHR64
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-30 00:00:00.000000000 Z
11
+ date: 2014-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xdg
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - 'ruby: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]'
115
115
  rubyforge_project:
116
- rubygems_version: 2.0.3
116
+ rubygems_version: 2.2.0
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: Automates certain XDG features.