hamburger 0.0.1 → 0.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: de5d56bafd8248d05670ffb314d9a6fc82ca05af
4
- data.tar.gz: fcc15c53088f363ae7bc517510b55c176eceeca2
3
+ metadata.gz: 5f8c3194fd8efb8abcf7a431a882ce2ec2ed93c8
4
+ data.tar.gz: 485703285b25152cfffcd0e6cce12f54848952d2
5
5
  SHA512:
6
- metadata.gz: 175d1d5f8fb660ced0b6ad4f9ad5f649470c9f9eb05c80ce4eea0d66e6bf9539b8c07c84aa337ec7e2dfc4faebe114ffa825c8d4ed9e547e514fca825e7985d2
7
- data.tar.gz: 4e226e14b65e50709387aa82d953a34015daf2cab7d92f083e28ea8068ca6ed915f017c51f7a3d676ecf8103e7f93650d7f07358b46365c4968037c0058646cf
6
+ metadata.gz: 285981f92a7a3256e2d1e13a5e88c78770adc914f8814d58c64a2d75d55abced76ddeed1c3726863c6c1f05b878352e859264ffdc1a2655642d3b1a2182b3fe0
7
+ data.tar.gz: 38b984cb57a70531448d4c69038283078c68b686983090ecf24de7b469d32b7bfe46fd93cfc7c1ca5f32161ddf0718d33bc1289fe3acad503f52b2bb5a1c9c73
@@ -1,6 +1,7 @@
1
1
  require "hamburger/version"
2
2
  require "railties/hamburger.rb"
3
+ require "modules/backupable.rb"
3
4
 
4
5
  module Hamburger
5
- # Your code goes here...
6
+
6
7
  end
@@ -1,3 +1,3 @@
1
1
  module Hamburger
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -0,0 +1,5 @@
1
+ module Backupable
2
+ def to_backupable_json
3
+ {self.class.name.downcase => self.attributes}.to_json
4
+ end
5
+ end
@@ -1,7 +1,15 @@
1
- class HamburgerRailtie < Rails::Railtie
2
- rake_tasks do
3
- Dir[File.join(File.dirname(__FILE__),'../tasks/')+"*.rb"].each do |file|
4
- load file
1
+ module HamburgerRails
2
+ class HamburgerRailtie < Rails::Railtie
3
+
4
+ initializer "hamburger_railtie.backupable" do
5
+ ActiveRecord::Base.send :include, Backupable
5
6
  end
7
+
8
+ rake_tasks do
9
+ Dir[File.join(File.dirname(__FILE__),'../tasks/')+"*.rb"].each do |file|
10
+ load file
11
+ end
12
+ end
13
+
6
14
  end
7
15
  end
@@ -8,7 +8,7 @@ namespace :hamburger do
8
8
  Rails.application.eager_load!
9
9
  ActiveRecord::Base.descendants.each do |record|
10
10
  record.all.each do |data|
11
- file_handle.write(data.to_json)
11
+ file_handle.write(data.to_backupable_json)
12
12
  file_handle.write("\n\r");
13
13
  end
14
14
  file_handle.write("\n\r")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hamburger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Pessetto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-19 00:00:00.000000000 Z
11
+ date: 2014-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -54,6 +54,7 @@ files:
54
54
  - hamburger.gemspec
55
55
  - lib/hamburger.rb
56
56
  - lib/hamburger/version.rb
57
+ - lib/modules/backupable.rb
57
58
  - lib/railties/hamburger.rb
58
59
  - lib/tasks/data_to_json.rb
59
60
  homepage: https://helpsheets.co