grape-starter 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/bin/grape-starter +0 -1
- data/lib/starter/builder.rb +1 -1
- data/lib/starter/builder/base_file.rb +1 -4
- data/lib/starter/builder/orms.rb +1 -0
- data/lib/starter/config.rb +12 -6
- data/lib/starter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41354a0a87f47c0f974e5c7b84d125a9200003d5
|
4
|
+
data.tar.gz: 16f9c3dd2cab7d87c13e0b0af299bb5a13667e81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba03f0e812e45ef087221cb970bb252d617e5ccb13e98b8463d480707f2c6279d1b9ba4f2a107fb8fe9683d4cf12086e7e4ab103653ba4cbf35b505fb8d0394f
|
7
|
+
data.tar.gz: 62dfe961d9b4494c09cc61b84ea230065ad33675037e8364e35f868092e7ae11dc88c6b6ef788c3c7d308f1d0cadb81a0d112839dcd4ef09306d0ed0f355bf1f
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
- contributions
|
4
4
|
|
5
|
+
### 0.8.1
|
6
|
+
|
7
|
+
- [6b16c…](https://github.com/LeFnord/grape-starter/commit/6b16c0bf38e4cad8d486e805269157dcbaefbb64) - removes default ORM value, minor corrections
|
8
|
+
|
5
9
|
### 0.8.0
|
6
10
|
|
7
11
|
- [#15](https://github.com/LeFnord/grape-starter/pull/15), [2af09…](https://github.com/LeFnord/grape-starter/commit/2af09dddf97f756e96c80c745ee68aad5ab4ccc3) **breaking change** prefix option on create is optional, no default
|
data/bin/grape-starter
CHANGED
data/lib/starter/builder.rb
CHANGED
@@ -26,10 +26,7 @@ module Starter
|
|
26
26
|
|
27
27
|
# parses out the prefix from base api file
|
28
28
|
def base_prefix
|
29
|
-
|
30
|
-
scan = base_file.scan(/prefix\s+(:.+)\n/)
|
31
|
-
scan.first.first.delete!(':') unless scan.empty?
|
32
|
-
# Starter::Config.read[:prefix]
|
29
|
+
Starter::Config.read[:prefix]
|
33
30
|
end
|
34
31
|
|
35
32
|
# parses out the version from base api file
|
data/lib/starter/builder/orms.rb
CHANGED
data/lib/starter/config.rb
CHANGED
@@ -2,17 +2,23 @@
|
|
2
2
|
|
3
3
|
module Starter
|
4
4
|
class Config
|
5
|
-
CONFIG_FILE = File.join(Dir.getwd, '.config')
|
6
5
|
class << self
|
7
|
-
def read
|
8
|
-
|
9
|
-
|
6
|
+
def read(dest: Dir.getwd)
|
7
|
+
@dest = dest
|
8
|
+
return {} unless File.exist?(config_file)
|
9
|
+
YAML.load_file(config_file)
|
10
10
|
end
|
11
11
|
|
12
12
|
def save(dest: Dir.getwd, content: nil)
|
13
|
+
@dest = dest
|
13
14
|
return if content.nil? || content.empty? || !content.is_a?(Hash)
|
14
|
-
|
15
|
-
|
15
|
+
existent = File.exist?(config_file) ? YAML.load_file(config_file) : {}
|
16
|
+
content = existent.merge(content)
|
17
|
+
File.open(config_file, 'w') { |f| f.write(YAML.dump(content)) }
|
18
|
+
end
|
19
|
+
|
20
|
+
def config_file
|
21
|
+
File.join(@dest, '.config')
|
16
22
|
end
|
17
23
|
end
|
18
24
|
end
|
data/lib/starter/version.rb
CHANGED