rails_reseed 0.0.1

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: ff8f4e03a08e27d10e2253d38c297ac8a3ae89ad
4
+ data.tar.gz: f53eb14124df96d62a51467b109b1721ffc0fb94
5
+ SHA512:
6
+ metadata.gz: 13cb6ad6bb09c73d8299331f60c222a59a3ca491845462d1af9401e1c86dbff5ccffe7a76eb9fea861017c8a61af42be0ac5b5438484826b7e3318eb7c1601a4
7
+ data.tar.gz: 203bb1861c4b947b242919ca3a4ea61f2b3e1810d1e1bb95048b5753d4d9aa8ae6121e6496b3935c980f5d22cffbfcb3b4ee92f40b7a9a562295ec51f0507bc8
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rails_reseed.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Jaymie Jones
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Rails Reseed
2
+
3
+ When working on a rails app in development you may want to start fresh
4
+ with the database, which is where this gem comes in.
5
+ As long as you have a seeds file with some initial data, this gem will
6
+ serve you well.
7
+
8
+ A new rake task is created that will drop the database, create the
9
+ database, run the migrations and reseed the newly created database with
10
+ your seed data.
11
+
12
+ Happy building!
13
+
14
+ Inspired by Nithin Bekal's article at
15
+ [http://nithinbekal.com/posts/rake-db-reseed/](http://nithinbekal.com/posts/rake-db-reseed/)
16
+
17
+ ## Installation
18
+
19
+ Add this line to your application's Gemfile in the development group:
20
+
21
+ ```ruby
22
+ gem 'rails_reseed'
23
+ ```
24
+
25
+ And then execute:
26
+
27
+ $ bundle
28
+
29
+ Or install it yourself as:
30
+
31
+ $ gem install rails_reseed
32
+
33
+ ## Usage
34
+
35
+ There is not much to do, install the gem then run Rake -T to find the
36
+ shiny new rake command.
37
+ To run, simply type ```rake db:reseed```
38
+
39
+ ## Contributing
40
+
41
+ 1. Fork it ( https://github.com/pixelstack/reseed/fork )
42
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
43
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
44
+ 4. Push to the branch (`git push origin my-new-feature`)
45
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,3 @@
1
+ module RailsReseed
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,18 @@
1
+ require "rails_reseed/version"
2
+ require 'rails'
3
+
4
+ module RailsReseed
5
+ class ReseedTasks
6
+ include Rake::DSL if defined? Rake::DSL
7
+
8
+ def install_tasks
9
+ namespace :db do
10
+ desc 'Drop, create, migrate then seed the development database'
11
+ task reseed: [ 'db:drop', 'db:create', 'db:migrate', 'db:seed' ] do
12
+ puts 'Reseeding completed.'
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ RailsReseed::ReseedTasks.new.install_tasks
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rails_reseed/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rails_reseed"
8
+ spec.version = RailsReseed::VERSION
9
+ spec.authors = ["Jaymie Jones"]
10
+ spec.email = ["jaymiejones86@gmail.com"]
11
+ spec.summary = %q{Implements a simple rails reseed rake task}
12
+ spec.description = %q{Implements a new rake task for rails applications that will drop the database, create it, migrate and then seed the clean database}
13
+ spec.homepage = "https://github.com/pixelstack/reseed"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_reseed
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jaymie Jones
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Implements a new rake task for rails applications that will drop the
42
+ database, create it, migrate and then seed the clean database
43
+ email:
44
+ - jaymiejones86@gmail.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - lib/rails_reseed.rb
55
+ - lib/rails_reseed/version.rb
56
+ - rails_reseed.gemspec
57
+ homepage: https://github.com/pixelstack/reseed
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.2.2
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: Implements a simple rails reseed rake task
81
+ test_files: []