sniff 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,6 +27,8 @@ class Sniff
27
27
  def Sniff.init(local_root, options = {})
28
28
  sniff = new local_root, options
29
29
  sniff.connect
30
+ sniff.migrate!
31
+ sniff.seed!
30
32
  sniff
31
33
  end
32
34
 
@@ -42,7 +44,6 @@ class Sniff
42
44
  # * :logger is a Logger log device used by Sniff and ActiveRecord (default: nil)
43
45
  # logger: nil = no log, string = file path, STDOUT for terminal
44
46
  # * :fixtures_path is the path to your gem's fixtures (default: local_root/lib/db/fixtures)
45
- # * :reset_schemas tells earth to recreate tables for each model (default: false)
46
47
  # * :cucumber tells Sniff to load cucumber test support files provided by the emitter in <emitter_root>/test_support/cucumber (default: false)
47
48
  # * :project is the current project (e.g. 'flight'). Default is guessed from CWD
48
49
  def initialize(local_root, options = {})
@@ -11,7 +11,7 @@ class Sniff
11
11
  next unless Object.const_defined?(model_name)
12
12
 
13
13
  model = model_name.constantize
14
- model.delete_all
14
+ model.create_table!
15
15
  CSV.foreach(fixture_file, :headers => true) do |row|
16
16
  ActiveRecord::Base.connection.insert_fixture(row, model.table_name) rescue ActiveRecord::RecordNotUnique
17
17
  end
@@ -56,6 +56,7 @@ class Sniff
56
56
  end
57
57
  end
58
58
 
59
+ desc "Load a console"
59
60
  task :console do
60
61
  require 'sniff'
61
62
  sniff = Sniff.new Dir.pwd
@@ -176,8 +177,8 @@ class Sniff
176
177
 
177
178
  if rspec
178
179
  require 'rspec/core/rake_task'
179
-
180
- desc "Run all examples"
180
+
181
+ desc "Run all rspec examples"
181
182
  RSpec::Core::RakeTask.new('examples') do |c|
182
183
  if ENV['RSPEC_FORMAT']
183
184
  c.rspec_opts = "-Ispec --format #{ENV['RSPEC_FORMAT']}"
@@ -197,6 +198,7 @@ class Sniff
197
198
  test_tasks << :examples if rspec
198
199
  test_tasks << :features if cucumber
199
200
  unless test_tasks.empty?
201
+ desc "Run tests"
200
202
  task :test => test_tasks
201
203
  task :default => :test
202
204
  end
@@ -1,3 +1,3 @@
1
1
  class Sniff
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -6,7 +6,7 @@ require 'earth/locality/petroleum_administration_for_defense_district'
6
6
  describe Sniff do
7
7
  let(:dirigible_path) { File.expand_path '../fixtures/dirigible', __FILE__ }
8
8
  let(:sniff) do
9
- sniff = Sniff.new(dirigible_path, :fixtures_path => dirigible_path + '/lib/test_support/db/fixtures', :project => 'sniff')
9
+ sniff = Sniff.new(dirigible_path, :project => 'sniff')
10
10
  sniff.connect
11
11
  sniff
12
12
  end
@@ -24,7 +24,6 @@ describe Sniff do
24
24
  should == ['', 'path','to','my','gems','sniff','lib','sniff','stuff.rb']
25
25
  end
26
26
  end
27
-
28
27
  describe '#migrate!' do
29
28
  it 'loads a schema for the emitter record' do
30
29
  sniff.migrate!
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sniff
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.0
5
+ version: 1.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Derek Kastner
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-11-06 00:00:00 Z
13
+ date: 2012-11-07 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -276,7 +276,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
276
276
  requirements:
277
277
  - - ">="
278
278
  - !ruby/object:Gem::Version
279
- hash: 2890552808498289512
279
+ hash: -2056840590517016300
280
280
  segments:
281
281
  - 0
282
282
  version: "0"