pliny 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pliny/config_helpers.rb +12 -2
- data/lib/pliny/tasks/db.rake +1 -1
- data/lib/pliny/version.rb +1 -1
- data/lib/template/config/config.rb +0 -1
- data/lib/template/config/puma.rb +1 -1
- data/spec/config_helpers_spec.rb +52 -0
- data/spec/support/config.rb +7 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fd74ed75ef414a1f1602c0548d2f56fdfb4d97d
|
4
|
+
data.tar.gz: 07b464141302bb46918948da5af25fcd5ee1ff0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 740e5f9300ec9d45f8f8bba3f4523684204a94fea7bfd5907a448a56783a791bd3a38d52d9817a51c48fdae2103e5edba5578e36f21916f4681704dd4dff0fbf
|
7
|
+
data.tar.gz: 76f70b7c91576c41c3f7101417512dce9a16915ea06b02cefee49631fecc38e6acaee001351c877630c506d5d83757233874cd66a47f91f86d02a2bf2bd82b14
|
data/lib/pliny/config_helpers.rb
CHANGED
@@ -49,6 +49,14 @@ module Pliny
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
def rack_env
|
53
|
+
if pliny_env == "development" || pliny_env == "test"
|
54
|
+
"development"
|
55
|
+
else
|
56
|
+
"deployment"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
52
60
|
private
|
53
61
|
|
54
62
|
def cast(value, method)
|
@@ -96,5 +104,7 @@ module Pliny
|
|
96
104
|
|
97
105
|
end
|
98
106
|
|
99
|
-
# Supress the "use RbConfig instead" warning
|
100
|
-
Object.
|
107
|
+
# Supress the "use RbConfig instead" warning
|
108
|
+
if Object.const_defined?(:Config) && !Config.is_a?(Pliny::CastingConfigHelpers)
|
109
|
+
Object.send(:remove_const, :Config)
|
110
|
+
end
|
data/lib/pliny/tasks/db.rake
CHANGED
@@ -92,7 +92,7 @@ begin
|
|
92
92
|
task :dump do
|
93
93
|
file = File.join("db", "schema.sql")
|
94
94
|
database_url = database_urls.first
|
95
|
-
`pg_dump -
|
95
|
+
`pg_dump -s -x -O -f #{file} #{database_url}`
|
96
96
|
|
97
97
|
schema = File.read(file)
|
98
98
|
# filter all COMMENT ON EXTENSION, only owners and the db
|
data/lib/pliny/version.rb
CHANGED
@@ -28,7 +28,6 @@ module Config
|
|
28
28
|
override :puma_max_threads, 16, int
|
29
29
|
override :puma_min_threads, 1, int
|
30
30
|
override :puma_workers, 3, int
|
31
|
-
override :rack_env, 'development', string
|
32
31
|
override :raise_errors, false, bool
|
33
32
|
override :root, File.expand_path("../../", __FILE__), string
|
34
33
|
override :timeout, 10, int
|
data/lib/template/config/puma.rb
CHANGED
@@ -0,0 +1,52 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "pliny/config_helpers"
|
3
|
+
|
4
|
+
describe Pliny::CastingConfigHelpers do
|
5
|
+
|
6
|
+
describe "#rack_env" do
|
7
|
+
it "is development if pliny_env is development" do
|
8
|
+
config = Class.new do
|
9
|
+
extend Pliny::CastingConfigHelpers
|
10
|
+
override :pliny_env, 'development', string
|
11
|
+
end
|
12
|
+
|
13
|
+
assert_equal "development", config.rack_env
|
14
|
+
end
|
15
|
+
|
16
|
+
it "is development if pliny_env is test" do
|
17
|
+
config = Class.new do
|
18
|
+
extend Pliny::CastingConfigHelpers
|
19
|
+
override :pliny_env, 'test', string
|
20
|
+
end
|
21
|
+
|
22
|
+
assert_equal "development", config.rack_env
|
23
|
+
end
|
24
|
+
|
25
|
+
it "is deployment if pliny_env is production" do
|
26
|
+
config = Class.new do
|
27
|
+
extend Pliny::CastingConfigHelpers
|
28
|
+
override :pliny_env, 'production', string
|
29
|
+
end
|
30
|
+
|
31
|
+
assert_equal "deployment", config.rack_env
|
32
|
+
end
|
33
|
+
|
34
|
+
it "is deployment if pliny_env is nil" do
|
35
|
+
config = Class.new do
|
36
|
+
extend Pliny::CastingConfigHelpers
|
37
|
+
override :pliny_env, '', string
|
38
|
+
end
|
39
|
+
|
40
|
+
assert_equal "deployment", config.rack_env
|
41
|
+
end
|
42
|
+
|
43
|
+
it "is deployment if pliny_env is another value" do
|
44
|
+
config = Class.new do
|
45
|
+
extend Pliny::CastingConfigHelpers
|
46
|
+
override :pliny_env, 'staging', string
|
47
|
+
end
|
48
|
+
|
49
|
+
assert_equal "deployment", config.rack_env
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
data/spec/support/config.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
+
require "pliny/config_helpers"
|
2
|
+
|
1
3
|
# Supress the "use RbConfig instead" warning.
|
2
|
-
Object.
|
4
|
+
if Object.const_defined?(:Config) && !Config.is_a?(Pliny::CastingConfigHelpers)
|
5
|
+
Object.send(:remove_const, :Config)
|
6
|
+
end
|
3
7
|
|
4
8
|
module Config
|
9
|
+
extend Pliny::CastingConfigHelpers
|
10
|
+
|
5
11
|
def self.pretty_json
|
6
12
|
true
|
7
13
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pliny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandur Leach
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-01-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -428,6 +428,7 @@ files:
|
|
428
428
|
- spec/commands/generator/serializer_spec.rb
|
429
429
|
- spec/commands/generator_spec.rb
|
430
430
|
- spec/commands/updater_spec.rb
|
431
|
+
- spec/config_helpers_spec.rb
|
431
432
|
- spec/db_support_spec.rb
|
432
433
|
- spec/errors_spec.rb
|
433
434
|
- spec/helpers/encode_spec.rb
|
@@ -464,7 +465,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
464
465
|
version: '0'
|
465
466
|
requirements: []
|
466
467
|
rubyforge_project:
|
467
|
-
rubygems_version: 2.4.
|
468
|
+
rubygems_version: 2.4.5.1
|
468
469
|
signing_key:
|
469
470
|
specification_version: 4
|
470
471
|
summary: Basic tooling to support API apps in Sinatra
|