slodd 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 972b123e01e797c443cffaff480a90f90415196c
4
+ data.tar.gz: 64811c0dc9e88dbf2b82319916385268f9ed0517
5
+ SHA512:
6
+ metadata.gz: 7e89ee99dd39964198122ae314181d768a6e296c9ac4f31cc1c2eebb98a02beba4acf25b4c52fbde81290d0923645734472747f0e846dd8e1f71dc3b2cdec14c
7
+ data.tar.gz: 5031641b783134bdf492b205d6204cfbe22d8cb2864e70178fe62929865f16323287667ebc2b7cfe2a77ccbeb2a63a30484f1db2fb2f1839a9e5076bc4122bba
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.1.5
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in slodd.gemspec
4
4
  gemspec
data/README.md CHANGED
@@ -2,6 +2,7 @@ Schema Loading On Dependent Databases
2
2
  =====================================
3
3
 
4
4
  [![Build Status](https://travis-ci.org/errm/slodd.png?branch=v0.1.0)](https://travis-ci.org/errm/slodd)
5
+ [![Gem Version](https://badge.fury.io/rb/slodd.png)](http://badge.fury.io/rb/slodd)
5
6
 
6
7
  Slodd is a lightweight tool for loading an activerecord schema.rb into a database, like rake db:schema:load but more awesome.
7
8
 
data/Rakefile CHANGED
@@ -1,8 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
- require 'rspec/core/rake_task'
3
- require 'rubocop/rake_task'
2
+ require "rspec/core/rake_task"
3
+ require "rubocop/rake_task"
4
4
 
5
- Rubocop::RakeTask.new(:rubocop)
5
+ RuboCop::RakeTask.new(:rubocop)
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- task :default => [:spec, :rubocop]
8
+ task default: [:spec, :rubocop]
data/bin/gurl CHANGED
@@ -14,7 +14,7 @@ OptionParser.new do |opt|
14
14
  end
15
15
 
16
16
  opt.on("-r", "--ref REF", "github ref") do |r|
17
- Slodd::Config.ref = g
17
+ Slodd::Config.ref = r
18
18
  end
19
19
 
20
20
  opt.on("-f", "--file-schema-path PATH", "Path to schema.rb") do |f|
data/bin/slodd CHANGED
@@ -22,7 +22,7 @@ OptionParser.new do |opt|
22
22
  end
23
23
 
24
24
  opt.on("-r", "--ref REF", "github ref") do |r|
25
- Slodd::Config.ref = g
25
+ Slodd::Config.ref = r
26
26
  end
27
27
 
28
28
  opt.on("-f", "--file-schema-path PATH", "Path to schema.rb") do |f|
data/lib/slodd/config.rb CHANGED
@@ -55,7 +55,7 @@ module Slodd
55
55
  token: token,
56
56
  path: path,
57
57
  ref: ref,
58
- url: url,
58
+ url: url
59
59
  }.delete_if { |_, v| v.nil? }
60
60
  end
61
61
  end
data/lib/slodd/github.rb CHANGED
@@ -30,7 +30,7 @@ module Slodd
30
30
  def headers
31
31
  {
32
32
  "Accept" => "application/vnd.github.3.raw",
33
- "Authorization" => "token #{token}",
33
+ "Authorization" => "token #{token}"
34
34
  }
35
35
  end
36
36
  end
data/lib/slodd/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Slodd
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
data/slodd.gemspec CHANGED
@@ -1,25 +1,26 @@
1
1
  # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'slodd/version'
4
+ require "slodd/version"
5
+ require "english"
5
6
 
6
7
  Gem::Specification.new do |gem|
7
8
  gem.name = "slodd"
8
9
  gem.version = Slodd::VERSION
9
10
  gem.authors = ["Ed Robinson"]
10
11
  gem.email = ["ed.robinson@reevoo.com"]
11
- gem.description = %q{Schema Loading On Dependent Databases}
12
- gem.summary = %q{Schema Loading On Dependent Databases}
12
+ gem.description = "Schema Loading On Dependent Databases"
13
+ gem.summary = "Schema Loading On Dependent Databases"
13
14
  gem.homepage = "https://github.com/errm/slodd"
14
15
 
15
- gem.files = `git ls-files`.split($/)
16
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
+ gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
+ gem.executables = gem.files.grep(/^bin\//).map { |f| File.basename(f) }
18
+ gem.test_files = gem.files.grep(/^(test|spec|features)\//)
18
19
  gem.require_paths = ["lib"]
19
- gem.add_dependency('activerecord')
20
- gem.add_dependency('mysql2')
21
- gem.add_development_dependency('rspec')
22
- gem.add_development_dependency('rake')
23
- gem.add_development_dependency('simplecov')
24
- gem.add_development_dependency('rubocop')
20
+ gem.add_dependency("activerecord")
21
+ gem.add_dependency("mysql2")
22
+ gem.add_development_dependency("rspec")
23
+ gem.add_development_dependency("rake")
24
+ gem.add_development_dependency("simplecov")
25
+ gem.add_development_dependency("rubocop")
25
26
  end
@@ -106,7 +106,7 @@ describe Slodd::Config do
106
106
  repo: "awesome_rails_app",
107
107
  token: "oauth token",
108
108
  path: "db/schema.rb",
109
- ref: "my-awesome-branch",
109
+ ref: "my-awesome-branch"
110
110
  }
111
111
  expect(subject.attributes).to eq attrs
112
112
  end
@@ -115,7 +115,7 @@ describe Slodd::Config do
115
115
  context "Local" do
116
116
  it "returns all the arguments needed by Local" do
117
117
  attrs = {
118
- path: "db/schema.rb",
118
+ path: "db/schema.rb"
119
119
  }
120
120
  expect(subject.attributes).to eq attrs
121
121
  end
@@ -126,7 +126,7 @@ describe Slodd::Config do
126
126
  subject.url = "http://some.url.com/db/schema.rb"
127
127
  attrs = {
128
128
  path: "db/schema.rb",
129
- url: "http://some.url.com/db/schema.rb",
129
+ url: "http://some.url.com/db/schema.rb"
130
130
  }
131
131
  expect(subject.attributes).to eq attrs
132
132
  end
@@ -136,12 +136,12 @@ describe Slodd::Config do
136
136
 
137
137
  describe ".databases" do
138
138
  it "defaults to empty array" do
139
- expect(subject.databases).to eq []
139
+ expect(subject.databases).to eq []
140
140
  end
141
141
 
142
142
  it "is an array of names" do
143
143
  subject.databases = "db1 db2 db3"
144
- expect(subject.databases).to eq %w[db1 db2 db3]
144
+ expect(subject.databases).to eq %w(db1 db2 db3)
145
145
  end
146
146
 
147
147
  it "is an array of one name" do
@@ -157,7 +157,7 @@ describe Slodd::Config do
157
157
  settings = {
158
158
  adapter: "mysql2",
159
159
  host: "localhost",
160
- username: "root",
160
+ username: "root"
161
161
  }
162
162
  expect(subject.database_settings).to eq settings
163
163
  end
@@ -171,7 +171,7 @@ describe Slodd::Config do
171
171
  adapter: "mysql2",
172
172
  host: "localhost",
173
173
  username: "root",
174
- password: "brian",
174
+ password: "brian"
175
175
  }
176
176
  expect(subject.database_settings).to eq settings
177
177
  end
@@ -28,7 +28,9 @@ describe Slodd::Runner do
28
28
  expect(Test.last.name).to eq "James"
29
29
  expect(`mysql -uroot -e "show databases;"`).to match(/slodd_test/)
30
30
 
31
- subject.run!
31
+ capture_stdout do
32
+ subject.run!
33
+ end
32
34
 
33
35
  expect(Test.count).to eq 0
34
36
  end
@@ -55,7 +57,7 @@ describe Slodd::Runner do
55
57
  context "when something is failing" do
56
58
  before do
57
59
  allow(ActiveRecord::Base).to receive(:establish_connection)
58
- .and_raise(Mysql2::Error, "mysql error")
60
+ .and_raise(Mysql2::Error, "mysql error")
59
61
  end
60
62
 
61
63
  it "ouputs a usefull message to stderr" do
data/spec/spec_helper.rb CHANGED
@@ -7,7 +7,6 @@ require "slodd"
7
7
  require "stringio"
8
8
 
9
9
  RSpec.configure do |config|
10
- config.treat_symbols_as_metadata_keys_with_true_values = true
11
10
  config.run_all_when_everything_filtered = true
12
11
  config.filter_run :focus
13
12
  config.order = "random"
@@ -28,11 +27,14 @@ end
28
27
 
29
28
  def capture_stderr
30
29
  old_stderr = $stderr
30
+ old_stdout = $stdout
31
31
  fake_stderr = StringIO.new
32
+ $stdout = StringIO.new
32
33
  $stderr = fake_stderr
33
34
  yield
34
35
  fake_stderr.string
35
36
  ensure
37
+ $stdout = old_stdout
36
38
  $stderr = old_stderr
37
39
  end
38
40
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  ActiveRecord::Schema.define(version: 1) do
3
3
  create_table "tests", force: true do |t|
4
- t.string "name"
4
+ t.string "name"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,110 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slodd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
5
- prerelease:
4
+ version: 0.1.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ed Robinson
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-21 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activerecord
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: mysql2
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rake
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: simplecov
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rubocop
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  description: Schema Loading On Dependent Databases
@@ -116,9 +103,11 @@ executables:
116
103
  extensions: []
117
104
  extra_rdoc_files: []
118
105
  files:
119
- - .gitignore
120
- - .rubocop.yml
121
- - .travis.yml
106
+ - ".gitignore"
107
+ - ".rspec"
108
+ - ".rubocop.yml"
109
+ - ".ruby-version"
110
+ - ".travis.yml"
122
111
  - Gemfile
123
112
  - README.md
124
113
  - Rakefile
@@ -141,33 +130,26 @@ files:
141
130
  - spec/support/schema.rb
142
131
  homepage: https://github.com/errm/slodd
143
132
  licenses: []
133
+ metadata: {}
144
134
  post_install_message:
145
135
  rdoc_options: []
146
136
  require_paths:
147
137
  - lib
148
138
  required_ruby_version: !ruby/object:Gem::Requirement
149
- none: false
150
139
  requirements:
151
- - - ! '>='
140
+ - - ">="
152
141
  - !ruby/object:Gem::Version
153
142
  version: '0'
154
- segments:
155
- - 0
156
- hash: -4230072505507451069
157
143
  required_rubygems_version: !ruby/object:Gem::Requirement
158
- none: false
159
144
  requirements:
160
- - - ! '>='
145
+ - - ">="
161
146
  - !ruby/object:Gem::Version
162
147
  version: '0'
163
- segments:
164
- - 0
165
- hash: -4230072505507451069
166
148
  requirements: []
167
149
  rubyforge_project:
168
- rubygems_version: 1.8.25
150
+ rubygems_version: 2.2.2
169
151
  signing_key:
170
- specification_version: 3
152
+ specification_version: 4
171
153
  summary: Schema Loading On Dependent Databases
172
154
  test_files:
173
155
  - spec/lib/config_spec.rb