ferry 1.0.1 → 1.1.0

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: 9d989398f2fb5ec29a7c7adb8eaa41d4a3ad73ed
4
- data.tar.gz: 64824ff7f371375b3d6c95bcedfd710679c3e5a0
3
+ metadata.gz: 3f65ccb6129a5a31a15a726e2424f438b9482e3f
4
+ data.tar.gz: 75f2cd24f3a7ea2f382c194fe4fecd983082879d
5
5
  SHA512:
6
- metadata.gz: e723f0054f7226ff6c9409743991214a718ed04e3fd9ae0dbdfff394838ec53d949b4bc7e42ac1f3f55d07334ca9281191e3737f5b576528110cf47f7e6ed211
7
- data.tar.gz: 534e64b15930ed77f2279abf0e156fd20f2178e0d8327eb0332a8fd81572d570f0d3ad97181e1796571cc299541385685ad3f26ab7cef59b22b076736388bbe3
6
+ metadata.gz: 060a53ed43bbed7094f6967d05979b7ddc51aa73dbb68fddf0f3e0c5258d567baabeacfba94cbfb163830496d86623475f32554ae56153f02c2adbd1134081d7
7
+ data.tar.gz: 425d84ab59ebf43283db4b3eec9a916d7dbf485e2ead0e6198c9f8ebc8ed5480e30915d97cae2f053fbce6108f213b5919254abdd7d50782cb69413bc3630e20
data/.travis.yml CHANGED
@@ -5,10 +5,19 @@ rvm:
5
5
  - 2.1.0
6
6
  - 2.1.2
7
7
  before_install:
8
+ - sudo apt-get autoremove sqlite3
9
+ - sudo apt-get install python-software-properties
10
+ - sudo apt-add-repository -y ppa:travis-ci/sqlite3
11
+ - sudo apt-get -y update
12
+ - sudo apt-cache show sqlite3
13
+ - sudo apt-get install sqlite3=3.7.15.1-1~travis1
14
+ - sudo sqlite3 -version
8
15
  - gem update bundler
9
16
  script:
17
+ - mysql -e 'create database ferry_test;'
18
+ - psql -c 'create database ferry_test;' -U postgres
10
19
  - bundle exec rspec
11
20
  branches:
12
21
  only:
13
22
  - master
14
- - production
23
+ - production
data/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  ![ferry](doc/ferry_readme_icon_2.png)
2
2
 
3
- <!-- ![Build Status](https://travis-ci.org/cmu-is-projects/ferry.png)(https://travis-ci.org/cmu-is-projects/ferry) -->
3
+ [![Build Status](https://travis-ci.org/cmu-is-projects/ferry.svg?branch=master)](https://travis-ci.org/cmu-is-projects/ferry)
4
+ [![Gem Version](https://badge.fury.io/rb/ferry.svg)](http://badge.fury.io/rb/ferry)
4
5
 
5
6
  ## What is Ferry?
6
- Ferry is a command-line tool rubygem designed for Rails data migrations and manipulation, maintained as an open-source project by the students of [Carnegie Mellon's Information Systems department](http://www.cmu.edu/information-systems/) currently [Anthony Corletti](http://github.com/anthcor) and [Logan Watanabe](http://github.com/loganwatanabe). The inspiration for ferry was brought from collective internship experiences and from the growing prevalence of big data migration and manipulation challenges that companies, corporations, universities, and organizations face in today's information age.
7
+ Ferry is a command-line tool rubygem designed for Rails data migrations and manipulation, primarily maintained as an open-source project by the students of [Carnegie Mellon's Information Systems department](http://www.cmu.edu/information-systems/) since August 2014. The inspiration for ferry was brought from collective internship experiences and from the growing prevalence of big data migration and manipulation challenges that companies, corporations, universities, and organizations face in today's information age. A large thanks in part to [CustomInk's Technology Team](https://github.com/customink) and their [blog articles](http://technology.customink.com) for advice and guidance during the first semester (Fall 2014) of development.
7
8
 
8
9
  ## What can I use Ferry for?
9
- See the [ferry_demo](http://github.com/cmu-is-projects/ferry_demo) app or our [GitHub pages site](http://cmu-is-projects.github.com/ferry) for guidance on using Ferry!
10
+ See the [ferry_demo](http://github.com/cmu-is-projects/ferry_demo) app or our [GitHub pages site](http://cmu-is-projects.github.com/ferry) for further documentation on using Ferry!
10
11
 
11
12
  Rails Migration and Manipulation use cases
12
13
  - Exporting data to various file formats (.csv, .yml, .sql)
@@ -14,6 +15,22 @@ Rails Migration and Manipulation use cases
14
15
  - Migrating data to third party hosts (Amazon S3, Oracle)
15
16
  - Migrating data to a different database
16
17
 
18
+ Coming soon ...
19
+ - Configurable Migration Scripting
20
+ - The idea behind this feature is for developers to provide options for arguments in an executable script that contains the configuration and necessary tasks/ actions for the operations of whatever data migration or manipulation they are seeking to carry out.
21
+ - Similar to how [capistrano's](https://github.com/capistrano/capistrano) configures deploy.rb.
22
+ - Data Visualization
23
+ - With inspiration from [d3](http://d3js.org), we are hoping to create functionality that allows developers to deploy informative and visually appealing graphs and documents that can be shared over an internal network to be broadcasted to servers for display either on internal office displays or to URL's ... all from executing a simple command-line statement.
24
+ - We will be making use of [d3](http://d3js.org) for visualizations and are looking for current solutions to this business need and if there are any successful or not-so-successful solutions out there to compete with.
25
+
26
+ ## Some current development items
27
+ #### Please feel free to open an issue or pull request with your suggestions
28
+ - Database-switcher guide tool
29
+ - 3rd party connections
30
+ - Configurability
31
+ - Allowing user to write own rake tasks (e.g. importing and exporting data to S3 or related services)
32
+ - Rolling back on errors or mishaps during migrations and manipulations
33
+
17
34
  ## Installation
18
35
  Add this line to your Rails application's Gemfile:
19
36
  ``` ruby
@@ -65,13 +82,6 @@ $ ferry --import development users db/csv/import_data.csv
65
82
  ```
66
83
  Running the above command will import the import_data.csv to the "users" table in the "development" environment.
67
84
 
68
- ## Some current development items
69
- #### Please feel free to open an issue or pull request with your suggestions
70
- - Database-switcher guide tool
71
- - 3rd party connections
72
- - Allowing user to write own rake tasks (e.g. importing and exporting data to S3 or related services)
73
- - Rolling back on errors or mishaps during migrations and manipulations
74
- - Host API and docs via GitHub pages
75
85
 
76
86
  ## Contributing
77
87
 
@@ -80,3 +90,7 @@ Running the above command will import the import_data.csv to the "users" table i
80
90
  3. Commit your changes (`git commit -am 'Add some feature'`)
81
91
  4. Push to the branch (`git push origin my-new-feature`)
82
92
  5. Create a new Pull Request
93
+
94
+ If you wish to open a pull request or issue for anything at all please feel free to do so!
95
+
96
+ A large driving factor in the development of Ferry is contributing something meaningful to the open-source community and the developer community at large. Being college students who have access to such an unbelievable amount of developement resources for creating cool projects, we felt a need to give back - we wanted to start a project that would face unique challenges such that others who face similar challenges could turn to us for help and guidance. We hope that Ferry continues to be a project that both provides benefit to businesses and developers along with giving back to the open-source and greater developer community.
@@ -16,7 +16,7 @@ module Ferry
16
16
  def insert_sql(model, columns, values)
17
17
  col_names_sql = "(#{columns.join(",")})"
18
18
  model_sql = model.downcase
19
- sql_insert_beg = "INSERT INTO #{model_sql} #{col_names_sql} VALUES "
19
+ sql_insert_beg = "INSERT INTO #{model_sql} #{col_names_sql} VALUES "
20
20
  ActiveRecord::Base.transaction do
21
21
  values.each_slice(500) do |records|
22
22
  sql_statement = sql_insert_beg + records.join(",") + ";"
data/lib/ferry/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ferry
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -15,6 +15,13 @@ postgresql: &postgresql
15
15
  adapter: postgresql
16
16
  min_messages: warning
17
17
 
18
+ postgresql_system_user_name: &postgresql_system_user_name
19
+ <<: *default
20
+ username: postgres
21
+ password: ' '
22
+ adapter: postgresql
23
+ min_messages: warning
24
+
18
25
  sqlite3: &sqlite3
19
26
  adapter: sqlite3
20
27
  database: test.db
@@ -23,4 +30,4 @@ oracle: &oracle
23
30
  adapter: oracle
24
31
  database: ferry_test
25
32
  user: root
26
- password:
33
+ password:
data/spec/models/cart.rb CHANGED
@@ -1,10 +1,5 @@
1
1
  class Cart < ActiveRecord::Base
2
-
3
2
  has_many :orders
4
-
5
-
6
3
  validates_presence_of :email
7
4
  validates_uniqueness_of :email
8
-
9
-
10
- end
5
+ end
@@ -1,7 +1,4 @@
1
1
  class Category < ActiveRecord::Base
2
-
3
2
  has_many :products
4
-
5
3
  validates_presence_of :name
6
-
7
- end
4
+ end
data/spec/models/order.rb CHANGED
@@ -1,7 +1,4 @@
1
1
  class Order < ActiveRecord::Base
2
-
3
2
  belongs_to :cart
4
3
  belongs_to :product
5
-
6
-
7
- end
4
+ end
@@ -1,9 +1,5 @@
1
1
  class Product < ActiveRecord::Base
2
-
3
2
  has_many :orders
4
3
  belongs_to :category
5
-
6
-
7
4
  validates_presence_of :name
8
-
9
- end
5
+ end
@@ -1,5 +1,4 @@
1
1
  def create_categories
2
- # assumes create_curriculums prior
3
2
  @food = FactoryGirl.create(:category)
4
3
  @cleaning = FactoryGirl.create(:category, name: "Cleaning Supplies", description: "Household cleaning products.")
5
4
  @antiques = FactoryGirl.create(:category, name: "Antiques", active: false, description:"No longer carried.")
@@ -1 +1 @@
1
- id,name,description,float_score,active
1
+ id,name,description,float_score,active
@@ -61,7 +61,7 @@ describe "#import" do
61
61
  Cart.delete_all
62
62
  end
63
63
 
64
- it "should be able to import >500 records" do
64
+ it "should be able to import > 500 records" do
65
65
  import_path = File.expand_path("..",Dir.pwd) + "/spec/support/emails_import.csv" #2100 records
66
66
  importer.import("sqlite3", "carts", import_path)
67
67
  expect(Cart.find_by(id: 42).email).to eql("Albert@example.com")
@@ -15,6 +15,11 @@ describe("utility functions") do
15
15
  expect(ActiveRecord::Base.connection.adapter_name).to eql('PostgreSQL')
16
16
  end
17
17
 
18
+ it "#postgresql fails if system user name is not role in PostgreSQL" do
19
+ expect{utils.db_connect("postgresql_system_user_name")}.not_to raise_error
20
+ expect{ActiveRecord::Base.connection.adapter_name}.not_to raise_error
21
+ end
22
+
18
23
  it "#mysql2" do
19
24
  expect{utils.db_connect("mysql2")}.not_to raise_error
20
25
  expect(ActiveRecord::Base.connection.adapter_name).to eql('Mysql2')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ferry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Corletti
@@ -10,160 +10,160 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-12-12 00:00:00.000000000 Z
13
+ date: 2015-01-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - "~>"
19
+ - - ~>
20
20
  - !ruby/object:Gem::Version
21
21
  version: 4.1.7
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - "~>"
26
+ - - ~>
27
27
  - !ruby/object:Gem::Version
28
28
  version: 4.1.7
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: bundler
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - "~>"
33
+ - - ~>
34
34
  - !ruby/object:Gem::Version
35
35
  version: '1.6'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - "~>"
40
+ - - ~>
41
41
  - !ruby/object:Gem::Version
42
42
  version: '1.6'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rake
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
47
+ - - ~>
48
48
  - !ruby/object:Gem::Version
49
49
  version: 10.3.2
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - "~>"
54
+ - - ~>
55
55
  - !ruby/object:Gem::Version
56
56
  version: 10.3.2
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: minitest
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - "~>"
61
+ - - ~>
62
62
  - !ruby/object:Gem::Version
63
63
  version: 5.4.1
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - "~>"
68
+ - - ~>
69
69
  - !ruby/object:Gem::Version
70
70
  version: 5.4.1
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rspec
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - "~>"
75
+ - - ~>
76
76
  - !ruby/object:Gem::Version
77
77
  version: 3.1.0
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - "~>"
82
+ - - ~>
83
83
  - !ruby/object:Gem::Version
84
84
  version: 3.1.0
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: pg
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - "~>"
89
+ - - ~>
90
90
  - !ruby/object:Gem::Version
91
91
  version: 0.17.1
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - "~>"
96
+ - - ~>
97
97
  - !ruby/object:Gem::Version
98
98
  version: 0.17.1
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: sqlite3
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - "~>"
103
+ - - ~>
104
104
  - !ruby/object:Gem::Version
105
105
  version: 1.3.10
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - "~>"
110
+ - - ~>
111
111
  - !ruby/object:Gem::Version
112
112
  version: 1.3.10
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: mysql2
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - "~>"
117
+ - - ~>
118
118
  - !ruby/object:Gem::Version
119
119
  version: 0.3.16
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - "~>"
124
+ - - ~>
125
125
  - !ruby/object:Gem::Version
126
126
  version: 0.3.16
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: factory_girl
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - "~>"
131
+ - - ~>
132
132
  - !ruby/object:Gem::Version
133
133
  version: 4.5.0
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - "~>"
138
+ - - ~>
139
139
  - !ruby/object:Gem::Version
140
140
  version: 4.5.0
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: progressbar
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - "~>"
145
+ - - ~>
146
146
  - !ruby/object:Gem::Version
147
147
  version: 0.21.0
148
148
  type: :runtime
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
- - - "~>"
152
+ - - ~>
153
153
  - !ruby/object:Gem::Version
154
154
  version: 0.21.0
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: highline
157
157
  requirement: !ruby/object:Gem::Requirement
158
158
  requirements:
159
- - - "~>"
159
+ - - ~>
160
160
  - !ruby/object:Gem::Version
161
161
  version: 1.6.21
162
162
  type: :runtime
163
163
  prerelease: false
164
164
  version_requirements: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - "~>"
166
+ - - ~>
167
167
  - !ruby/object:Gem::Version
168
168
  version: 1.6.21
169
169
  description: Ferry is a data migration and data manipulation tool that seeks to simplify
@@ -177,9 +177,9 @@ executables:
177
177
  extensions: []
178
178
  extra_rdoc_files: []
179
179
  files:
180
- - ".gitignore"
181
- - ".rspec"
182
- - ".travis.yml"
180
+ - .gitignore
181
+ - .rspec
182
+ - .travis.yml
183
183
  - Gemfile
184
184
  - LICENSE.txt
185
185
  - README.md
@@ -230,17 +230,17 @@ require_paths:
230
230
  - lib
231
231
  required_ruby_version: !ruby/object:Gem::Requirement
232
232
  requirements:
233
- - - ">="
233
+ - - '>='
234
234
  - !ruby/object:Gem::Version
235
235
  version: '0'
236
236
  required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  requirements:
238
- - - ">="
238
+ - - '>='
239
239
  - !ruby/object:Gem::Version
240
240
  version: '0'
241
241
  requirements: []
242
242
  rubyforge_project:
243
- rubygems_version: 2.2.2
243
+ rubygems_version: 2.0.14
244
244
  signing_key:
245
245
  specification_version: 4
246
246
  summary: Ferry is a data migration and data manipulation tool