stones 0.1.4 → 0.1.8

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6af7f9044e4fafeee9cc83fa246f4fda3ed0dc65
4
+ data.tar.gz: 2d3554410479e77c723e1f742f34093e535cb0b7
5
+ SHA512:
6
+ metadata.gz: 521979488cf97f811cdfdf9194b669c4d214e9d7acaef8870ec44add5f67637313e1ef13076df5783684ac52e7fd4f9e4d833c12a84861b44b0d60e4df220c96
7
+ data.tar.gz: 33a9a2117e500e835bac1f935be958c4a488a5900104283a1bfdbecba2aeba5783089355dc6b2a9537e3d064b9885e29129aaeddc7afa90fa1f1cadf5073b689
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ rails-4.0
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.0.0
data/Gemfile.lock CHANGED
@@ -1,121 +1,102 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actionmailer (3.2.9)
5
- actionpack (= 3.2.9)
6
- mail (~> 2.4.4)
7
- actionpack (3.2.9)
8
- activemodel (= 3.2.9)
9
- activesupport (= 3.2.9)
10
- builder (~> 3.0.0)
4
+ actionmailer (4.0.0)
5
+ actionpack (= 4.0.0)
6
+ mail (~> 2.5.3)
7
+ actionpack (4.0.0)
8
+ activesupport (= 4.0.0)
9
+ builder (~> 3.1.0)
11
10
  erubis (~> 2.7.0)
12
- journey (~> 1.0.4)
13
- rack (~> 1.4.0)
14
- rack-cache (~> 1.2)
15
- rack-test (~> 0.6.1)
16
- sprockets (~> 2.2.1)
17
- activemodel (3.2.9)
18
- activesupport (= 3.2.9)
19
- builder (~> 3.0.0)
20
- activerecord (3.2.9)
21
- activemodel (= 3.2.9)
22
- activesupport (= 3.2.9)
23
- arel (~> 3.0.2)
24
- tzinfo (~> 0.3.29)
25
- activeresource (3.2.9)
26
- activemodel (= 3.2.9)
27
- activesupport (= 3.2.9)
28
- activesupport (3.2.9)
29
- i18n (~> 0.6)
30
- multi_json (~> 1.0)
31
- addressable (2.3.2)
32
- arel (3.0.2)
33
- builder (3.0.4)
34
- capybara (2.0.1)
11
+ rack (~> 1.5.2)
12
+ rack-test (~> 0.6.2)
13
+ activemodel (4.0.0)
14
+ activesupport (= 4.0.0)
15
+ builder (~> 3.1.0)
16
+ activerecord (4.0.0)
17
+ activemodel (= 4.0.0)
18
+ activerecord-deprecated_finders (~> 1.0.2)
19
+ activesupport (= 4.0.0)
20
+ arel (~> 4.0.0)
21
+ activerecord-deprecated_finders (1.0.3)
22
+ activesupport (4.0.0)
23
+ i18n (~> 0.6, >= 0.6.4)
24
+ minitest (~> 4.2)
25
+ multi_json (~> 1.3)
26
+ thread_safe (~> 0.1)
27
+ tzinfo (~> 0.3.37)
28
+ arel (4.0.0)
29
+ atomic (1.1.10)
30
+ builder (3.1.4)
31
+ capybara (2.1.0)
35
32
  mime-types (>= 1.16)
36
33
  nokogiri (>= 1.3.3)
37
34
  rack (>= 1.0.0)
38
35
  rack-test (>= 0.5.4)
39
- selenium-webdriver (~> 2.0)
40
- xpath (~> 1.0.0)
41
- childprocess (0.3.6)
42
- ffi (~> 1.0, >= 1.0.6)
43
- diff-lcs (1.1.3)
36
+ xpath (~> 2.0)
37
+ diff-lcs (1.2.4)
44
38
  erubis (2.7.0)
45
- ffi (1.2.0)
46
- hike (1.2.1)
47
- i18n (0.6.1)
48
- journey (1.0.4)
49
- json (1.7.5)
50
- libwebsocket (0.1.7.1)
51
- addressable
52
- websocket
53
- mail (2.4.4)
54
- i18n (>= 0.4.0)
39
+ hike (1.2.3)
40
+ i18n (0.6.4)
41
+ mail (2.5.4)
55
42
  mime-types (~> 1.16)
56
43
  treetop (~> 1.4.8)
57
- mime-types (1.19)
58
- multi_json (1.4.0)
59
- nokogiri (1.5.5)
44
+ mime-types (1.23)
45
+ mini_portile (0.5.1)
46
+ minitest (4.7.5)
47
+ multi_json (1.7.7)
48
+ nokogiri (1.6.0)
49
+ mini_portile (~> 0.5.0)
60
50
  polyglot (0.3.3)
61
- rack (1.4.1)
62
- rack-cache (1.2)
63
- rack (>= 0.4)
64
- rack-ssl (1.3.2)
65
- rack
51
+ rack (1.5.2)
66
52
  rack-test (0.6.2)
67
53
  rack (>= 1.0)
68
- rails (3.2.9)
69
- actionmailer (= 3.2.9)
70
- actionpack (= 3.2.9)
71
- activerecord (= 3.2.9)
72
- activeresource (= 3.2.9)
73
- activesupport (= 3.2.9)
74
- bundler (~> 1.0)
75
- railties (= 3.2.9)
76
- railties (3.2.9)
77
- actionpack (= 3.2.9)
78
- activesupport (= 3.2.9)
79
- rack-ssl (~> 1.3.2)
54
+ rails (4.0.0)
55
+ actionmailer (= 4.0.0)
56
+ actionpack (= 4.0.0)
57
+ activerecord (= 4.0.0)
58
+ activesupport (= 4.0.0)
59
+ bundler (>= 1.3.0, < 2.0)
60
+ railties (= 4.0.0)
61
+ sprockets-rails (~> 2.0.0)
62
+ railties (4.0.0)
63
+ actionpack (= 4.0.0)
64
+ activesupport (= 4.0.0)
80
65
  rake (>= 0.8.7)
81
- rdoc (~> 3.4)
82
- thor (>= 0.14.6, < 2.0)
83
- rake (10.0.2)
84
- rdoc (3.12)
85
- json (~> 1.4)
86
- rspec-core (2.12.1)
87
- rspec-expectations (2.12.0)
88
- diff-lcs (~> 1.1.3)
89
- rspec-mocks (2.12.0)
90
- rspec-rails (2.12.0)
66
+ thor (>= 0.18.1, < 2.0)
67
+ rake (10.1.0)
68
+ rspec-core (2.14.3)
69
+ rspec-expectations (2.14.0)
70
+ diff-lcs (>= 1.1.3, < 2.0)
71
+ rspec-mocks (2.14.1)
72
+ rspec-rails (2.14.0)
91
73
  actionpack (>= 3.0)
92
74
  activesupport (>= 3.0)
93
75
  railties (>= 3.0)
94
- rspec-core (~> 2.12.0)
95
- rspec-expectations (~> 2.12.0)
96
- rspec-mocks (~> 2.12.0)
97
- rubyzip (0.9.9)
98
- selenium-webdriver (2.26.0)
99
- childprocess (>= 0.2.5)
100
- libwebsocket (~> 0.1.3)
101
- multi_json (~> 1.0)
102
- rubyzip
76
+ rspec-core (~> 2.14.0)
77
+ rspec-expectations (~> 2.14.0)
78
+ rspec-mocks (~> 2.14.0)
103
79
  spork (0.9.2)
104
- sprockets (2.2.2)
80
+ sprockets (2.10.0)
105
81
  hike (~> 1.2)
106
82
  multi_json (~> 1.0)
107
83
  rack (~> 1.0)
108
84
  tilt (~> 1.1, != 1.3.0)
109
- sqlite3 (1.3.6)
110
- thor (0.16.0)
111
- tilt (1.3.3)
112
- treetop (1.4.12)
85
+ sprockets-rails (2.0.0)
86
+ actionpack (>= 3.0)
87
+ activesupport (>= 3.0)
88
+ sprockets (~> 2.8)
89
+ sqlite3 (1.3.7)
90
+ thor (0.18.1)
91
+ thread_safe (0.1.0)
92
+ atomic
93
+ tilt (1.4.1)
94
+ treetop (1.4.14)
113
95
  polyglot
114
96
  polyglot (>= 0.3.1)
115
- tzinfo (0.3.35)
97
+ tzinfo (0.3.37)
116
98
  watchr (0.7)
117
- websocket (1.0.4)
118
- xpath (1.0.0)
99
+ xpath (2.0.0)
119
100
  nokogiri (~> 1.3)
120
101
 
121
102
  PLATFORMS
@@ -1,4 +1,13 @@
1
- - str = "| #{APP.capitalize} #{VERSION} | Rails #{Rails.version} | #{STARTED_AT}"
1
+ ruby:
2
+ app = "#{APP.capitalize} #{VERSION}"
3
+ if Rails.env.production?
4
+ ruby = "Ruby #{RUBY_VERSION}"
5
+ rails = "Rails #{Rails.version}"
6
+ else
7
+ ruby = "Ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
8
+ rails = "Rails #{Rails.version} (#{Rails.env})"
9
+ end
10
+ str = "| #{app} | #{ruby} | #{rails} | #{STARTED_AT}"
2
11
 
3
12
  table
4
13
  tr
@@ -1,5 +1,5 @@
1
1
  title = (APP || 'app').capitalize
2
- link rel='shortcut icon' href='/images/matique.ico'
2
+ link rel='shortcut icon' href='/matique.ico'
3
3
  = stylesheet_link_tag @stylesheet || 'application', media: 'all'
4
4
  = stylesheet_link_tag 'print', media: 'print'
5
5
  = javascript_include_tag 'application'
@@ -1,3 +1,3 @@
1
1
  module Stones
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.8'
3
3
  end
@@ -0,0 +1,92 @@
1
+ def dir
2
+ unless @dir
3
+ @dir = "#{Rails.root}/db/backup"
4
+ FileUtils.mkdir_p(@dir)
5
+ end
6
+ @dir
7
+ end
8
+
9
+ def interesting_tables
10
+ rval = ActiveRecord::Base.connection.tables.sort
11
+ rval.reject! do |tbl|
12
+ ['schema_migrations','schema_info', 'sessions', 'public_exceptions'].include?(tbl)
13
+ end
14
+ rval
15
+ end
16
+
17
+ namespace :db do
18
+ namespace :backup do
19
+
20
+ desc "Dump entire db."
21
+ task :write => :environment do
22
+ FileUtils.chdir(dir)
23
+ interesting_tables.each do |tbl|
24
+ klass = tbl.classify.constantize
25
+ puts "Writing #{tbl}..."
26
+ File.open("#{tbl}.yml", 'w+') { |f| YAML.dump klass.find(:all).collect(&:attributes), f }
27
+ end
28
+ FileUtils.chdir(Rails.root)
29
+ end
30
+
31
+ desc "Loads the entire db."
32
+ task :read => [:environment, 'db:schema:load'] do
33
+ FileUtils.chdir(dir)
34
+
35
+ interesting_tables.each do |tbl|
36
+ ActiveRecord::Base.transaction do
37
+ begin
38
+ klass = tbl.classify.constantize
39
+ klass.destroy_all
40
+ klass.reset_column_information
41
+
42
+ puts "Loading #{tbl}..."
43
+ YAML.load_file("#{tbl}.yml").each do |fixture|
44
+ data = {}
45
+ klass.columns.each do |c|
46
+ # filter out missing columns
47
+ data[c.name] = fixture[c.name] if fixture[c.name]
48
+ end
49
+ sql = "INSERT INTO #{tbl} "
50
+ sql += "(#{data.keys.map{|kk| "#{kk}"}.join(",")}) "
51
+ sql += "VALUES (#{data.values.collect { |value| ActiveRecord::Base.connection.quote(value) }.join(",")})"
52
+
53
+ ActiveRecord::Base.connection.execute sql, 'Fixture Insert'
54
+ end
55
+ rescue Exception => exc
56
+ puts "failed to load table #{tbl}; Exception: #{exc}"
57
+ end
58
+ end
59
+ end
60
+ end
61
+
62
+ desc "Loads a table; e.g. rake db:backup:load[users]"
63
+ task :load, [:table] => :environment do |t, args|
64
+ FileUtils.chdir(dir)
65
+
66
+ tbl = args.table
67
+ ActiveRecord::Base.transaction do
68
+ begin
69
+ klass = tbl.classify.constantize
70
+ klass.reset_column_information
71
+ puts "Loading #{tbl}..."
72
+ YAML.load_file("#{tbl}.yml").each do |fixture|
73
+ data = {}
74
+ klass.columns.each do |c|
75
+ # filter out missing columns
76
+ data[c.name] = fixture[c.name] if fixture[c.name]
77
+ end
78
+ sql = "INSERT INTO #{tbl} "
79
+ sql += "(#{data.keys.map{|kk| "#{kk}"}.join(",")}) "
80
+ sql += "VALUES (#{data.values.collect { |value| ActiveRecord::Base.connection.quote(value) }.join(",")})"
81
+
82
+ ActiveRecord::Base.connection.execute sql, 'Fixture Insert'
83
+
84
+ end
85
+ rescue Exception => exc
86
+ puts "failed to load table #{tbl}; Exception: #{exc}"
87
+ end
88
+ end
89
+ end
90
+
91
+ end
92
+ end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stones
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
5
- prerelease:
4
+ version: 0.1.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Dittmar Krall
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-03 00:00:00.000000000 Z
11
+ date: 2013-07-14 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: A collection of, hopefully, useful files.
15
14
  email:
@@ -18,6 +17,8 @@ executables: []
18
17
  extensions: []
19
18
  extra_rdoc_files: []
20
19
  files:
20
+ - .ruby-gemset
21
+ - .ruby-version
21
22
  - .watchr
22
23
  - Gemfile
23
24
  - Gemfile.lock
@@ -41,29 +42,29 @@ files:
41
42
  - lib/stones.rb
42
43
  - lib/stones/engine.rb
43
44
  - lib/stones/version.rb
45
+ - lib/tasks/backup.rake
44
46
  - stones.gemspec
45
47
  homepage: http://matique.de
46
48
  licenses: []
49
+ metadata: {}
47
50
  post_install_message:
48
51
  rdoc_options: []
49
52
  require_paths:
50
53
  - lib
51
54
  required_ruby_version: !ruby/object:Gem::Requirement
52
- none: false
53
55
  requirements:
54
- - - ! '>='
56
+ - - '>='
55
57
  - !ruby/object:Gem::Version
56
58
  version: '0'
57
59
  required_rubygems_version: !ruby/object:Gem::Requirement
58
- none: false
59
60
  requirements:
60
- - - ! '>='
61
+ - - '>='
61
62
  - !ruby/object:Gem::Version
62
63
  version: '0'
63
64
  requirements: []
64
65
  rubyforge_project:
65
- rubygems_version: 1.8.24
66
+ rubygems_version: 2.0.3
66
67
  signing_key:
67
- specification_version: 3
68
+ specification_version: 4
68
69
  summary: Stones contains some basic files.
69
70
  test_files: []