gris 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +45 -8
- data/gris.gemspec +1 -0
- data/lib/gris/setup.rb +0 -8
- data/lib/gris/version.rb +1 -1
- data/lib/tasks/db.rake +6 -72
- data/lib/tasks/routes.rake +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1844ff0da2b765f419c75ba83eaa1c09e2997af
|
4
|
+
data.tar.gz: 64953a88f2539ad4226939bd17a57ff630c48462
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8711f2778844cd3f8625e03ba8b9f22e82c20f675688afc5434244df6f2f7a6902084d65a909d119992fe3ca96a89109c8896d5c936c9ebbe0148d88541161d0
|
7
|
+
data.tar.gz: 37b472636c273327b7ea5454ec4dd64a191ed29704a40f39af786e81bc8129edc693729c609c90ed9e72baab6d31a96cb7eb0375ef20122307706ef41583677b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gris (0.5.
|
4
|
+
gris (0.5.8)
|
5
|
+
active_record_migrations
|
5
6
|
activesupport (~> 4.2, >= 4.2.0)
|
6
7
|
chronic (~> 0.10.0)
|
7
8
|
dalli (~> 2.7)
|
@@ -20,6 +21,23 @@ PATH
|
|
20
21
|
GEM
|
21
22
|
remote: https://rubygems.org/
|
22
23
|
specs:
|
24
|
+
actionpack (4.2.4)
|
25
|
+
actionview (= 4.2.4)
|
26
|
+
activesupport (= 4.2.4)
|
27
|
+
rack (~> 1.6)
|
28
|
+
rack-test (~> 0.6.2)
|
29
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
30
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
31
|
+
actionview (4.2.4)
|
32
|
+
activesupport (= 4.2.4)
|
33
|
+
builder (~> 3.1)
|
34
|
+
erubis (~> 2.7.0)
|
35
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
36
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
37
|
+
active_record_migrations (4.2.4.1)
|
38
|
+
activerecord (= 4.2.4)
|
39
|
+
railties (= 4.2.4)
|
40
|
+
rake
|
23
41
|
activemodel (4.2.4)
|
24
42
|
activesupport (= 4.2.4)
|
25
43
|
builder (~> 3.1)
|
@@ -52,11 +70,12 @@ GEM
|
|
52
70
|
coercible (1.0.0)
|
53
71
|
descendants_tracker (~> 0.0.1)
|
54
72
|
colorize (0.7.7)
|
55
|
-
dalli (2.7.
|
73
|
+
dalli (2.7.5)
|
56
74
|
descendants_tracker (0.0.4)
|
57
75
|
thread_safe (~> 0.3, >= 0.3.1)
|
58
76
|
diff-lcs (1.2.5)
|
59
77
|
equalizer (0.0.11)
|
78
|
+
erubis (2.7.0)
|
60
79
|
fakefs (0.6.7)
|
61
80
|
faraday (0.9.2)
|
62
81
|
multipart-post (>= 1.2, < 3)
|
@@ -73,7 +92,7 @@ GEM
|
|
73
92
|
ffi (1.9.10)
|
74
93
|
futuroscope (0.1.11)
|
75
94
|
git (1.2.9.1)
|
76
|
-
grape (0.
|
95
|
+
grape (0.14.0)
|
77
96
|
activesupport
|
78
97
|
builder
|
79
98
|
hashie (>= 2.1.0)
|
@@ -89,10 +108,10 @@ GEM
|
|
89
108
|
grape-roar (0.3.0)
|
90
109
|
grape
|
91
110
|
roar (>= 1.0)
|
92
|
-
grape-swagger (0.10.
|
111
|
+
grape-swagger (0.10.4)
|
93
112
|
grape (>= 0.8.0)
|
94
|
-
grape-entity
|
95
|
-
hashie (3.4.
|
113
|
+
grape-entity (< 0.5.0)
|
114
|
+
hashie (3.4.3)
|
96
115
|
hashie-forbidden_attributes (0.1.1)
|
97
116
|
hashie (>= 3.0)
|
98
117
|
hyperclient (0.7.2)
|
@@ -112,11 +131,16 @@ GEM
|
|
112
131
|
logging (2.0.0)
|
113
132
|
little-plugger (~> 1.1)
|
114
133
|
multi_json (~> 1.10)
|
134
|
+
loofah (2.0.3)
|
135
|
+
nokogiri (>= 1.5.9)
|
136
|
+
mini_portile2 (2.0.0)
|
115
137
|
minitest (5.8.1)
|
116
138
|
multi_json (1.11.2)
|
117
139
|
multi_xml (0.5.5)
|
118
140
|
multipart-post (2.0.0)
|
119
141
|
net-http-digest_auth (1.4)
|
142
|
+
nokogiri (1.6.7.1)
|
143
|
+
mini_portile2 (~> 2.0.0.rc2)
|
120
144
|
parser (2.2.2.6)
|
121
145
|
ast (>= 1.1, < 3.0)
|
122
146
|
powerpack (0.1.1)
|
@@ -130,12 +154,25 @@ GEM
|
|
130
154
|
racksh (1.0.0)
|
131
155
|
rack (>= 1.0)
|
132
156
|
rack-test (>= 0.5)
|
157
|
+
rails-deprecated_sanitizer (1.0.3)
|
158
|
+
activesupport (>= 4.2.0.alpha)
|
159
|
+
rails-dom-testing (1.0.7)
|
160
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
161
|
+
nokogiri (~> 1.6.0)
|
162
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
163
|
+
rails-html-sanitizer (1.0.2)
|
164
|
+
loofah (~> 2.0)
|
165
|
+
railties (4.2.4)
|
166
|
+
actionpack (= 4.2.4)
|
167
|
+
activesupport (= 4.2.4)
|
168
|
+
rake (>= 0.8.7)
|
169
|
+
thor (>= 0.18.1, < 2.0)
|
133
170
|
rainbow (2.0.0)
|
134
171
|
rake (10.4.2)
|
135
172
|
representable (2.3.0)
|
136
173
|
uber (~> 0.0.7)
|
137
|
-
roar (1.0.
|
138
|
-
representable (>= 2.0.1,
|
174
|
+
roar (1.0.4)
|
175
|
+
representable (>= 2.0.1, < 2.4.0)
|
139
176
|
rspec (3.3.0)
|
140
177
|
rspec-core (~> 3.3.0)
|
141
178
|
rspec-expectations (~> 3.3.0)
|
data/gris.gemspec
CHANGED
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.add_runtime_dependency 'chronic', '~> 0.10.0'
|
33
33
|
s.add_runtime_dependency 'dalli', '~> 2.7'
|
34
34
|
s.add_runtime_dependency 'indefinite_article', '~> 0.2'
|
35
|
+
s.add_runtime_dependency 'active_record_migrations'
|
35
36
|
|
36
37
|
s.add_development_dependency 'bundler', '~> 1'
|
37
38
|
s.add_development_dependency 'rspec', '~> 3.3'
|
data/lib/gris/setup.rb
CHANGED
@@ -24,14 +24,6 @@ module Gris
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def db_connection_details
|
28
|
-
if ENV['DATABASE_URL']
|
29
|
-
ActiveRecord::ConnectionAdapters::ConnectionSpecification::ConnectionUrlResolver.new(ENV['DATABASE_URL']).to_hash
|
30
|
-
else
|
31
|
-
YAML.load(ERB.new(File.read('./config/database.yml')).result)[Gris.env]
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
27
|
def cache
|
36
28
|
@_cache ||= ActiveSupport::Cache.lookup_store(:memory_store)
|
37
29
|
end
|
data/lib/gris/version.rb
CHANGED
data/lib/tasks/db.rake
CHANGED
@@ -1,75 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require './config/application.rb'
|
4
|
-
fail 'ActiveRecord Not Found' unless Module.const_defined?(:ActiveRecord)
|
5
|
-
end
|
6
|
-
|
7
|
-
namespace :db do
|
8
|
-
desc 'Migrate the database through scripts in db/migrate. Target specific version with VERSION=x'
|
9
|
-
task migrate: :environment do
|
10
|
-
ActiveRecord::Migrator.migrate('db/migrate', ENV['VERSION'] ? ENV['VERSION'].to_i : nil)
|
11
|
-
Rake::Task['db:schema:dump'].invoke unless Gris.env.production?
|
12
|
-
end
|
13
|
-
|
14
|
-
desc 'Rollback to a previous migration. Go back multiple steps with STEP=x'
|
15
|
-
task rollback: :environment do
|
16
|
-
ActiveRecord::Migration.verbose = true
|
17
|
-
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
|
18
|
-
ActiveRecord::Migrator.rollback('db/migrate', step)
|
19
|
-
end
|
20
|
-
|
21
|
-
desc 'Create the database'
|
22
|
-
task create: :environment do
|
23
|
-
db = Gris.db_connection_details
|
24
|
-
admin_connection = db.merge(database: 'postgres',
|
25
|
-
schema_search_path: 'public')
|
26
|
-
ActiveRecord::Base.establish_connection(admin_connection)
|
27
|
-
begin
|
28
|
-
ActiveRecord::Base.connection.create_database(db['database'])
|
29
|
-
rescue ActiveRecord::StatementInvalid => e
|
30
|
-
if e.message =~ /DuplicateDatabase/
|
31
|
-
$stderr.puts "#{admin_connection['database']} already exists"
|
32
|
-
else
|
33
|
-
raise
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
1
|
+
if File.file? 'config/database.yml'
|
2
|
+
require 'active_record_migrations'
|
37
3
|
|
38
|
-
|
39
|
-
|
40
|
-
db = Gris.db_connection_details
|
41
|
-
admin_connection = db.merge(database: 'postgres',
|
42
|
-
schema_search_path: 'public')
|
43
|
-
ActiveRecord::Base.establish_connection(admin_connection)
|
44
|
-
ActiveRecord::Base.connection.drop_database(db['database'])
|
45
|
-
end
|
46
|
-
|
47
|
-
desc 'Recreate the database, load the schema, and initialize with the seed data'
|
48
|
-
task reset: :environment do
|
49
|
-
Rake::Task['db:drop'].invoke
|
50
|
-
Rake::Task['db:create'].invoke
|
51
|
-
Rake::Task['db:schema:load'].invoke
|
52
|
-
end
|
53
|
-
|
54
|
-
namespace :schema do
|
55
|
-
desc 'Create a db/schema.rb file that can be portably used against any DB supported by AR'
|
56
|
-
task dump: :environment do
|
57
|
-
require 'active_record/schema_dumper'
|
58
|
-
File.open(ENV['SCHEMA'] || 'db/schema.rb', 'w') do |file|
|
59
|
-
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, file)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
desc 'Load a schema.rb file into the database'
|
64
|
-
task load: :environment do
|
65
|
-
file = ENV['SCHEMA'] || 'db/schema.rb'
|
66
|
-
db = Gris.db_connection_details
|
67
|
-
admin_connection = db.merge(database: 'postgres',
|
68
|
-
schema_search_path: 'public')
|
69
|
-
ActiveRecord::Base.establish_connection(admin_connection)
|
70
|
-
ActiveRecord::Schema.verbose = true
|
71
|
-
load(file)
|
72
|
-
end
|
73
|
-
end
|
4
|
+
ActiveRecordMigrations.configure do |c|
|
5
|
+
c.yaml_config = 'config/database.yml'
|
74
6
|
end
|
7
|
+
|
8
|
+
ActiveRecordMigrations.load_tasks
|
75
9
|
end
|
data/lib/tasks/routes.rake
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gris
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Fareed
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -236,6 +236,20 @@ dependencies:
|
|
236
236
|
- - "~>"
|
237
237
|
- !ruby/object:Gem::Version
|
238
238
|
version: '0.2'
|
239
|
+
- !ruby/object:Gem::Dependency
|
240
|
+
name: active_record_migrations
|
241
|
+
requirement: !ruby/object:Gem::Requirement
|
242
|
+
requirements:
|
243
|
+
- - ">="
|
244
|
+
- !ruby/object:Gem::Version
|
245
|
+
version: '0'
|
246
|
+
type: :runtime
|
247
|
+
prerelease: false
|
248
|
+
version_requirements: !ruby/object:Gem::Requirement
|
249
|
+
requirements:
|
250
|
+
- - ">="
|
251
|
+
- !ruby/object:Gem::Version
|
252
|
+
version: '0'
|
239
253
|
- !ruby/object:Gem::Dependency
|
240
254
|
name: bundler
|
241
255
|
requirement: !ruby/object:Gem::Requirement
|
@@ -423,7 +437,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
423
437
|
version: '0'
|
424
438
|
requirements: []
|
425
439
|
rubyforge_project:
|
426
|
-
rubygems_version: 2.4.
|
440
|
+
rubygems_version: 2.4.8
|
427
441
|
signing_key:
|
428
442
|
specification_version: 4
|
429
443
|
summary: A simple api microservice generator framework.
|