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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1ea08cf350172c2ab73709dd71a577f961aae09
4
- data.tar.gz: f96afa1f7bbe6224735327391fe49bb9e21cb9a1
3
+ metadata.gz: df329369f9eb159b53451c1e3f628473f1e49fa4
4
+ data.tar.gz: 41b87bc8a711934325c5819223b2e4081ee66fbf
5
5
  SHA512:
6
- metadata.gz: 18f9f21f9becb8ec1a5f1fdea351f79b87625451ea173ccbf5abe6fca244675fcd0452872cb0025d83588dfa2526215f9053287cf8575b610f2eec6b6b944231
7
- data.tar.gz: 714b246726fcbec24ffa397c39e980f604597302c721e86d17201f7f14d220a5f7e70ba293f3d373adcc25b8689cb6b997d156b5f0f73e3b03f3879100531ae8
6
+ metadata.gz: ca212ab526e8d512cc4b59f1eb1969f529ab412a640ec5f335046a88095d534f02aedc915acc29f96ad883eabe8ae8db80db3d918cf6dbef24376a63c50497aa
7
+ data.tar.gz: ec001cf38c088954c9cee2846930f58946ae5819934a9dda4912668190b803f58e91a4acb682da0182164d1782654538958a4697ef097684a01cfc1658a6d2f6
@@ -24,7 +24,7 @@ module SchemaDev
24
24
  end
25
25
 
26
26
  def sub_matrix(lines)
27
- pattern = %r{^\[//\]: # SCHEMA_DEV: MATRIX}
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 << "[//]: # SCHEMA_DEV: MATRIX - begin\n"
36
- contents << "[//]: # These lines are auto-generated by schema_dev based on schema_dev.yml\n"
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 << "\n"
41
- contents << "[//]: # SCHEMA_DEV: MATRIX - end\n"
40
+ contents << "<!-- SCHEMA_DEV: MATRIX - end -->\n"
42
41
 
43
42
  before + contents + after
44
43
  end
@@ -1,3 +1,3 @@
1
1
  module SchemaDev
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
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('git init')
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
@@ -1,6 +1,7 @@
1
1
  /coverage
2
2
  /tmp
3
3
  /pkg
4
+ /Gemfile.local
4
5
 
5
6
  *.lock
6
7
  *.log
@@ -20,7 +20,7 @@ gem "%GEM_NAME%"
20
20
 
21
21
  %GEM_NAME% is tested on
22
22
 
23
- [//]: # SCHEMA_DEV: MATRIX
23
+ <!-- SCHEMA_DEV: MATRIX -->
24
24
 
25
25
  ## Usage
26
26
 
@@ -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.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-25 00:00:00.000000000 Z
11
+ date: 2015-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport