davidtrogers-steamer 0.1.2.1243976709 → 0.1.3.0
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.
- data/.gitignore +1 -1
- data/README +12 -2
- data/Rakefile +2 -3
- data/VERSION +1 -0
- data/lib/steamer.rb +17 -10
- data/steamer.gemspec +6 -3
- metadata +3 -2
data/.gitignore
CHANGED
data/README
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
ToDo:
|
|
2
|
-
- get it working with sqlite3
|
|
2
|
+
- Done - get it working with sqlite3
|
|
3
|
+
- May want to read from the models... that way, we can stay db agnostic...
|
|
4
|
+
- can we use reflect_on_association??? is this too hard?
|
|
5
|
+
- how can we structure this so that it makes sense? are we replicating effort?
|
|
6
|
+
- we could require the model files, create instances in memory without writing to the db, then when we have to, write to the test db.
|
|
7
|
+
- want to have it in memory the way you want it, and write to the db at each iteration instead of recreating the database manually.
|
|
8
|
+
- we should stay away from the database itself until we write it... to the test db at each interval
|
|
9
|
+
- get it working with cucumber first...
|
|
10
|
+
- construct the data automatically, minimal effort to construct factories yall...
|
|
11
|
+
- the instances should be created with restrictions in mind
|
|
12
|
+
- should Steamer be of type ActiveRecord::Base to take advantage of reflect on association?
|
|
3
13
|
- read from database
|
|
4
14
|
- write it to factory directory in rb files
|
|
5
15
|
- instantiate it correctly in env.rb or wherever the factories are normally created (cucumber, rspec, etc.)
|
|
6
16
|
- get associations made correctly using model associations
|
|
7
17
|
- test out the factories
|
|
8
18
|
- write some specs
|
|
9
|
-
-
|
|
19
|
+
- we want to have a version of the database that we can go back to...
|
data/Rakefile
CHANGED
|
@@ -15,7 +15,6 @@ begin
|
|
|
15
15
|
gem.require_paths = ["lib"]
|
|
16
16
|
gem.rubygems_version = %q{1.3.3}
|
|
17
17
|
gem.add_dependency "activerecord"
|
|
18
|
-
gem.version = final_version
|
|
19
18
|
# puts "version: #{version}.#{Time.now.to_i}"
|
|
20
19
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
|
21
20
|
# if s.respond_to? :specification_version then
|
|
@@ -33,8 +32,8 @@ rescue LoadError
|
|
|
33
32
|
end
|
|
34
33
|
|
|
35
34
|
#
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
# -*- encoding: utf-8 -*-
|
|
36
|
+
|
|
38
37
|
# Gem::Specification.new do |s|
|
|
39
38
|
# s.name = %q{davidtrogers-grit}
|
|
40
39
|
# s.version = "0.4.4"
|
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.2
|
data/lib/steamer.rb
CHANGED
|
@@ -3,33 +3,40 @@ require 'sqlite3'
|
|
|
3
3
|
|
|
4
4
|
class Steamer
|
|
5
5
|
|
|
6
|
-
attr_accessor :source_db_connection,
|
|
6
|
+
attr_accessor :source_db_connection,
|
|
7
|
+
:source_db,
|
|
8
|
+
:magic
|
|
7
9
|
|
|
8
10
|
def initialize
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
connect
|
|
12
|
+
@magic = "hello"
|
|
11
13
|
end
|
|
12
14
|
|
|
13
15
|
def connect # assuming sqlite3 db at the moment
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
@source_db_name = Dir[File.join("./*/development.sqlite3")].first
|
|
17
|
+
@destination_db_name = Dir[File.join("./*/test.sqlite3")].first
|
|
16
18
|
# read from sqlite3 db
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
@source_db= ActiveRecord::Base.establish_connection({:adapter => "sqlite3",
|
|
20
|
+
:database => @source_db_name})
|
|
21
|
+
@source_db_connection = @source_db.connection
|
|
20
22
|
@source_db.connected?
|
|
21
23
|
end
|
|
22
24
|
|
|
23
25
|
def make_factory(table_name)
|
|
26
|
+
|
|
27
|
+
#
|
|
28
|
+
|
|
24
29
|
# This shows the columns for a particular table
|
|
25
30
|
# >> puts s.source_db_connection.columns("work_efforts").each {|a| puts a.inspect}
|
|
26
31
|
|
|
27
32
|
# This shows all of the tables
|
|
28
|
-
|
|
33
|
+
# >> puts s.source_db_connection.tables
|
|
29
34
|
|
|
30
35
|
# This returns a hash of the table structure
|
|
31
36
|
# >> puts s.source_db_connection.table_structure("work_efforts")
|
|
32
|
-
|
|
33
37
|
end
|
|
38
|
+
|
|
39
|
+
# protected
|
|
40
|
+
|
|
34
41
|
end
|
|
35
42
|
|
data/steamer.gemspec
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
+
|
|
2
3
|
Gem::Specification.new do |s|
|
|
3
4
|
s.name = %q{steamer}
|
|
4
|
-
s.version = "0.1.
|
|
5
|
+
s.version = "0.1.3.0"
|
|
6
|
+
|
|
5
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
6
8
|
s.authors = ["Dave Rogers"]
|
|
7
9
|
s.date = %q{2009-06-02}
|
|
@@ -18,6 +20,7 @@ Gem::Specification.new do |s|
|
|
|
18
20
|
"README",
|
|
19
21
|
"README.rdoc",
|
|
20
22
|
"Rakefile",
|
|
23
|
+
"VERSION",
|
|
21
24
|
"lib/steamer.rb",
|
|
22
25
|
"spec/spec_helper.rb",
|
|
23
26
|
"spec/steamer_spec.rb",
|
|
@@ -29,8 +32,8 @@ Gem::Specification.new do |s|
|
|
|
29
32
|
s.rubygems_version = %q{1.3.3}
|
|
30
33
|
s.summary = %q{when you want to dup a db for use in factories without the hassle of creating factories by hand}
|
|
31
34
|
s.test_files = [
|
|
32
|
-
"spec/
|
|
33
|
-
"spec/
|
|
35
|
+
"spec/steamer_spec.rb",
|
|
36
|
+
"spec/spec_helper.rb"
|
|
34
37
|
]
|
|
35
38
|
|
|
36
39
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: davidtrogers-steamer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dave Rogers
|
|
@@ -39,6 +39,7 @@ files:
|
|
|
39
39
|
- README
|
|
40
40
|
- README.rdoc
|
|
41
41
|
- Rakefile
|
|
42
|
+
- VERSION
|
|
42
43
|
- lib/steamer.rb
|
|
43
44
|
- spec/spec_helper.rb
|
|
44
45
|
- spec/steamer_spec.rb
|
|
@@ -71,5 +72,5 @@ signing_key:
|
|
|
71
72
|
specification_version: 3
|
|
72
73
|
summary: when you want to dup a db for use in factories without the hassle of creating factories by hand
|
|
73
74
|
test_files:
|
|
74
|
-
- spec/spec_helper.rb
|
|
75
75
|
- spec/steamer_spec.rb
|
|
76
|
+
- spec/spec_helper.rb
|