props 1.0.3 → 1.1.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.
File without changes
data/Manifest.txt CHANGED
@@ -1,10 +1,9 @@
1
- History.md
1
+ HISTORY.md
2
2
  Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
5
  lib/props.rb
6
6
  lib/props/db.rb
7
- lib/props/db/deleter.rb
8
7
  lib/props/db/models.rb
9
8
  lib/props/db/schema.rb
10
9
  lib/props/env.rb
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ Hoe.spec 'props' do
15
15
 
16
16
  # switch extension to .markdown for gihub formatting
17
17
  self.readme_file = 'README.md'
18
- self.history_file = 'History.md'
18
+ self.history_file = 'HISTORY.md'
19
19
 
20
20
  self.licenses = ['Public Domain']
21
21
 
@@ -23,4 +23,4 @@ Hoe.spec 'props' do
23
23
  :required_ruby_version => '>= 1.9.2'
24
24
  }
25
25
 
26
- end
26
+ end
data/lib/props.rb CHANGED
@@ -41,11 +41,9 @@ module ConfUtils
41
41
  "props/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
42
42
  end
43
43
 
44
- =begin
45
44
  def self.root
46
45
  "#{File.expand_path( File.dirname(File.dirname(__FILE__)) )}"
47
46
  end
48
- =end
49
47
 
50
48
  end # module ConfUtils
51
49
 
data/lib/props/db.rb CHANGED
@@ -8,9 +8,8 @@ require 'active_record' ## todo: add sqlite3? etc.
8
8
 
9
9
  # our own code
10
10
 
11
- require 'props/db/models'
12
11
  require 'props/db/schema'
13
- require 'props/db/deleter'
12
+ require 'props/db/models'
14
13
 
15
14
 
16
15
  module ConfDb
@@ -24,19 +23,23 @@ module ConfDb
24
23
  CreateDb.new.up
25
24
  end
26
25
 
26
+
27
27
  # delete ALL records (use with care!)
28
28
  def self.delete!
29
29
  puts '*** deleting props table records/data...'
30
- Deleter.new.run
30
+ Model::Prop.delete_all
31
31
  end # method delete!
32
32
 
33
- def self.stats
34
- # to be done
35
- end
33
+ ## def self.stats ## remove ? -- duplicate - use tables - why?? why not????
34
+ ## puts "#{Model::Prop} props"
35
+ ## end
36
36
 
37
+ def self.tables
38
+ puts "#{Model::Prop} props"
39
+ end
37
40
 
38
41
  end # module ConfDb
39
42
 
40
43
 
41
44
 
42
- puts ConfDb.banner if $DEBUG # say hello
45
+ puts ConfDb.banner # say hello
@@ -1,13 +1,16 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module ConfDb
4
- module Models
4
+ module Model
5
5
 
6
6
 
7
7
  class Prop < ActiveRecord::Base
8
-
8
+ ## some code here
9
9
  end # class Prop
10
10
 
11
+ end # module Model
12
+
13
+ ##### add convenience module alias in plural e.g. lets you use include ConfDb::Models
14
+ Models = Model
11
15
 
12
- end # module Models
13
16
  end # module ConfDb
@@ -6,8 +6,8 @@ class CreateDb < ActiveRecord::Migration
6
6
  def up
7
7
 
8
8
  create_table :props do |t|
9
- t.string :key, :null => false
10
- t.string :value, :null => false
9
+ t.string :key, null: false
10
+ t.string :value, null: false
11
11
  t.string :kind # e.g. version|user|sys(tem)|db etc. # note: can NOT use type - already used by ActiveRecord
12
12
  t.timestamps
13
13
  end
data/lib/props/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  module ConfUtils
3
- VERSION = '1.0.3'
3
+ VERSION = '1.1.0'
4
4
  end
data/test/test_ini.rb CHANGED
@@ -1,8 +1,3 @@
1
- ###
2
- # to run use
3
- # ruby -I ./lib -I ./test test/test_ini.rb
4
- # or better
5
- # rake test
6
1
 
7
2
  require 'helper'
8
3
 
@@ -36,15 +31,15 @@ EOS
36
31
  hash = INI.load( text )
37
32
  pp hash
38
33
 
39
- assert_equal( 'hello', hash['key1'] )
40
- assert_equal( 'hi!', hash['key2'] )
41
- assert_equal( 'salut', hash['section1']['key3'] )
42
- assert_equal( 'hola', hash['section2']['key4'] )
43
- assert_equal( '', hash['section2']['blank'] )
44
- assert_equal( '', hash['section2']['blank2'] )
45
- assert_equal( 'A rose is a rose is a rose, eh?', hash['http://example.com']['title'] )
46
- assert_equal( 'A rose is a rose is a rose, eh?', hash['http://example.com']['title2'] )
47
- assert_equal( 'A rose is a rose is a rose, eh?', hash['http://example.com']['title3'] )
34
+ assert_equal 'hello', hash['key1']
35
+ assert_equal 'hi!', hash['key2']
36
+ assert_equal 'salut', hash['section1']['key3']
37
+ assert_equal 'hola', hash['section2']['key4']
38
+ assert_equal '', hash['section2']['blank']
39
+ assert_equal '', hash['section2']['blank2']
40
+ assert_equal 'A rose is a rose is a rose, eh?', hash['http://example.com']['title']
41
+ assert_equal 'A rose is a rose is a rose, eh?', hash['http://example.com']['title2']
42
+ assert_equal 'A rose is a rose is a rose, eh?', hash['http://example.com']['title3']
48
43
  end
49
44
 
50
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: props
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-09 00:00:00.000000000 Z
12
+ date: 2014-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc
16
- requirement: &82474830 !ruby/object:Gem::Requirement
16
+ requirement: &71776850 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.10'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *82474830
24
+ version_requirements: *71776850
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: hoe
27
- requirement: &82474420 !ruby/object:Gem::Requirement
27
+ requirement: &71916910 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '3.3'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *82474420
35
+ version_requirements: *71916910
36
36
  description: props - Manage Settings Hierachies (Commandline, User, Home, Defaults,
37
37
  etc.)
38
38
  email: webslideshow@googlegroups.com
@@ -41,13 +41,12 @@ extensions: []
41
41
  extra_rdoc_files:
42
42
  - Manifest.txt
43
43
  files:
44
- - History.md
44
+ - HISTORY.md
45
45
  - Manifest.txt
46
46
  - README.md
47
47
  - Rakefile
48
48
  - lib/props.rb
49
49
  - lib/props/db.rb
50
- - lib/props/db/deleter.rb
51
50
  - lib/props/db/models.rb
52
51
  - lib/props/db/schema.rb
53
52
  - lib/props/env.rb
@@ -1,15 +0,0 @@
1
-
2
- module ConfDb
3
-
4
- class Deleter
5
- include ConfDb::Models
6
-
7
- def run
8
- # for now delete all tables
9
-
10
- Prop.delete_all
11
- end
12
-
13
- end # class Deleter
14
-
15
- end # module ConfDb