schema_dev 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/schema_dev/readme.rb +4 -5
- data/lib/schema_dev/version.rb +1 -1
- data/spec/gem_spec.rb +9 -1
- data/templates/gem/.gitignore +1 -0
- data/templates/gem/README.md +1 -1
- data/templates/gem/lib/GEM_NAME.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df329369f9eb159b53451c1e3f628473f1e49fa4
|
4
|
+
data.tar.gz: 41b87bc8a711934325c5819223b2e4081ee66fbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca212ab526e8d512cc4b59f1eb1969f529ab412a640ec5f335046a88095d534f02aedc915acc29f96ad883eabe8ae8db80db3d918cf6dbef24376a63c50497aa
|
7
|
+
data.tar.gz: ec001cf38c088954c9cee2846930f58946ae5819934a9dda4912668190b803f58e91a4acb682da0182164d1782654538958a4697ef097684a01cfc1658a6d2f6
|
data/lib/schema_dev/readme.rb
CHANGED
@@ -24,7 +24,7 @@ module SchemaDev
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def sub_matrix(lines)
|
27
|
-
pattern = %r{^\
|
27
|
+
pattern = %r{^\s*<!-- SCHEMA_DEV: MATRIX}
|
28
28
|
before = lines.take_while(&it !~ pattern)
|
29
29
|
|
30
30
|
return lines if before == lines
|
@@ -32,13 +32,12 @@ module SchemaDev
|
|
32
32
|
after = lines.reverse.take_while(&it !~ pattern).reverse
|
33
33
|
|
34
34
|
contents = []
|
35
|
-
contents << "
|
36
|
-
contents << "
|
35
|
+
contents << "<!-- SCHEMA_DEV: MATRIX - begin -->\n"
|
36
|
+
contents << "<!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->\n"
|
37
37
|
self.matrix.group_by(&it.slice(:ruby, :rails)).each do |pair, items|
|
38
38
|
contents << "* ruby **#{pair[:ruby]}** with rails **#{pair[:rails]}**, using #{items.map{|item| "**#{item[:db]}**"}.to_sentence(last_word_connector: ' or ')}\n"
|
39
39
|
end
|
40
|
-
contents << "
|
41
|
-
contents << "[//]: # SCHEMA_DEV: MATRIX - end\n"
|
40
|
+
contents << "<!-- SCHEMA_DEV: MATRIX - end -->\n"
|
42
41
|
|
43
42
|
before + contents + after
|
44
43
|
end
|
data/lib/schema_dev/version.rb
CHANGED
data/spec/gem_spec.rb
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
require 'schema_dev/gem'
|
2
2
|
|
3
3
|
describe SchemaDev::Gem do
|
4
|
+
|
5
|
+
let(:user_name) { "My Name" }
|
6
|
+
let(:user_email) { "my_name@example.com" }
|
7
|
+
|
4
8
|
before(:each) do
|
5
9
|
stub_request(:get, 'https://rubygems.org/api/v1/versions/schema_monkey.json').to_return body: JSON.generate([{ built_at: Time.now, number: "0.1.2"}])
|
10
|
+
allow_any_instance_of(SchemaDev::Gem).to receive(:`).with("git config user.name").and_return user_name
|
11
|
+
allow_any_instance_of(SchemaDev::Gem).to receive(:`).with("git config user.email").and_return user_email
|
6
12
|
end
|
7
13
|
|
8
14
|
around(:each) do |example|
|
@@ -16,6 +22,8 @@ describe SchemaDev::Gem do
|
|
16
22
|
expect{SchemaDev::Gem.build("NewGem")}.not_to raise_error
|
17
23
|
gemspec = File.read "new_gem/new_gem.gemspec"
|
18
24
|
expect(gemspec).to include %q{"schema_monkey", "~> 0.1", ">= 0.1.2"}
|
25
|
+
expect(gemspec).to match(/authors.*#{user_name}/)
|
26
|
+
expect(gemspec).to match(/email.*#{user_email}/)
|
19
27
|
end
|
20
28
|
end
|
21
29
|
|
@@ -36,7 +44,7 @@ describe SchemaDev::Gem do
|
|
36
44
|
|
37
45
|
it "when in git worktree" do
|
38
46
|
in_tmpdir do
|
39
|
-
system(
|
47
|
+
expect_any_instance_of(SchemaDev::Gem).to receive(:system).with(/^git rev-parse/).and_return true
|
40
48
|
expect{SchemaDev::Gem.build("NewGem")}.to raise_error SystemExit, /\bgit\b/
|
41
49
|
end
|
42
50
|
end
|
data/templates/gem/.gitignore
CHANGED
data/templates/gem/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require 'schema_monkey'
|
2
2
|
|
3
|
+
require_relative '%GEM_NAME%/version'
|
4
|
+
|
5
|
+
|
3
6
|
# Load any mixins to ActiveRecord modules, such as:
|
4
7
|
#
|
5
8
|
# require_relative '%GEM_NAME%/active_record/base'
|
@@ -16,6 +19,7 @@ require 'schema_monkey'
|
|
16
19
|
# Any modules named %GEM_MODULE%::Middleware::<submodule-path> will
|
17
20
|
# automatically have their .insert method called.
|
18
21
|
|
22
|
+
|
19
23
|
# Database adapter-specific mixin, if any, will automatically #include'd in
|
20
24
|
# its counterpart depending on which database adapter is in use.
|
21
25
|
module %GEM_MODULE%
|
@@ -29,7 +33,6 @@ module %GEM_MODULE%
|
|
29
33
|
end
|
30
34
|
|
31
35
|
|
32
|
-
|
33
36
|
# Extra load-time initialization can go here. You can delete this if you don't have any.
|
34
37
|
module %GEM_MODULE%
|
35
38
|
def self.insert
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ronen barzel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|