pinas 0.2.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f3e0589de892a856a621dab3247b245fa0c72c2
4
- data.tar.gz: fb51bfa96a76568878edbefd459e1c0d8f3b20d2
3
+ metadata.gz: 2e42c3d7b5af11358027438b4e9e75d41cc8129d
4
+ data.tar.gz: e114c975299f1a21a48818d82fe6c55c3a6bd060
5
5
  SHA512:
6
- metadata.gz: f839829bd90ca9c479531ceec0884f4f034c6c34957ecfeba598a44a4b22a44343bb7cfc55d48f4f633679abe2d37e490a4d176b792d0a8cf65a31f8abce5e4f
7
- data.tar.gz: 926674ff93cb19e2c609332843c235085c3eda39f2d20347798f2d58b21cf60d431c39e0b08091b11a1b61e17f6f4fdbe8faa9281a56079e0b85d127e57fbefd
6
+ metadata.gz: 5cca07a128f08d441921c5f46d2c82513a836a1ed6568b32bc9731c2bd1699ff099a54282e3bfd4643a723e7c27c791e618f0f7631a678fadc936a8313806067
7
+ data.tar.gz: ec783c1d28afc47318fb2355c59daa4f3fbee4085809a86ff463838177bb12604c838adc6176a2add1126b46d0ec62d709e01a22839daf381c9402b3046ba046
data/README.md CHANGED
@@ -67,7 +67,7 @@ Or you may want to extend the model
67
67
 
68
68
  ## Caveats
69
69
 
70
- At the moment this gem only supports Ruby >= 1.9.3, Rails 4.x and Mysql adapter
70
+ At the moment this gem only supports Ruby >= 1.9.3, Rails 4.x and ActiveRecord compatible storage
71
71
 
72
72
 
73
73
  ## TODO
@@ -1,4 +1,5 @@
1
1
  require "pinas/version"
2
+ require "pinas/loader"
2
3
 
3
4
  module Pinas
4
5
  autoload :Location, "pinas/location"
@@ -0,0 +1,16 @@
1
+ require 'fileutils'
2
+ require 'yaml_db'
3
+
4
+ module Pinas
5
+ class Loader
6
+
7
+ def self.run
8
+ SerializationHelper::Base.new(YamlDb::Helper).load(data_file)
9
+ end
10
+
11
+ def self.data_file
12
+ File.expand_path("../data/data.yml", __FILE__)
13
+ end
14
+
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Pinas
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -1,12 +1,6 @@
1
- require 'fileutils'
2
-
3
1
  namespace :pinas do
4
2
  desc "Load Philippines locations, includes Region, provinces, towns and barangays"
5
3
  task :load_data => :environment do
6
- data_file = File.expand_path("../../pinas/data/data.yml", __FILE__)
7
- data_dir = "#{Rails.root}/db/"
8
- FileUtils.cp(data_file, data_dir)
9
- Rake::Task["db:data:load"].execute
10
- File.delete("#{data_dir}data.yml")
4
+ Pinas::Loader.run
11
5
  end
12
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allan Andal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-12 00:00:00.000000000 Z
11
+ date: 2015-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -133,6 +133,7 @@ files:
133
133
  - lib/generators/templates/migration.rb
134
134
  - lib/pinas.rb
135
135
  - lib/pinas/data/data.yml
136
+ - lib/pinas/loader.rb
136
137
  - lib/pinas/location.rb
137
138
  - lib/pinas/railtie.rb
138
139
  - lib/pinas/version.rb