redis_importer 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/railtie.rb +9 -0
- data/lib/redis_importer/tasks.rb +15 -0
- data/lib/redis_importer/version.rb +1 -1
- data/lib/tasks/redis_importer.rake +3 -0
- data/spec/redis_importer_spec.rb +3 -3
- metadata +17 -14
data/lib/railtie.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'redis_importer'
|
2
|
+
|
3
|
+
if defined?(Rails) && File.exists?(Rails.root.join("config/initializers", "local.rb"))
|
4
|
+
require Rails.root.join("config/initializers", "local.rb")
|
5
|
+
end
|
6
|
+
|
7
|
+
namespace :redis_importer do
|
8
|
+
desc 'Run import'
|
9
|
+
task 'import' => :environment do
|
10
|
+
ri = RedisImporter::RedisImporter.new
|
11
|
+
ri.import
|
12
|
+
result = ri.errors
|
13
|
+
puts "test: #{result}"
|
14
|
+
end
|
15
|
+
end
|
data/spec/redis_importer_spec.rb
CHANGED
@@ -12,10 +12,10 @@ describe RedisImporter do
|
|
12
12
|
bucket_name = collection['bucket']
|
13
13
|
Bucket.create(bucket_name)
|
14
14
|
@bucket = Bucket.find(bucket_name)
|
15
|
-
|
15
|
+
|
16
16
|
test_csv_files = Dir.glob("test/csv/*.csv")
|
17
17
|
test_class_names = test_csv_files.map {|f| File.basename(f).gsub('.csv','').capitalize}
|
18
|
-
|
18
|
+
|
19
19
|
test_csv_files.each do |file_path|
|
20
20
|
filename = File.basename(file_path)
|
21
21
|
file = File.open(file_path)
|
@@ -28,7 +28,7 @@ describe RedisImporter do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it "determines its file storage type from a configuration file" do
|
31
|
-
@ri.settings[
|
31
|
+
@ri.settings['storage_method'].should == @configuration['storage_method']
|
32
32
|
end
|
33
33
|
|
34
34
|
it "uses its storage method to get a file collection module" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis_importer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-09-
|
13
|
+
date: 2012-09-14 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
17
|
-
requirement: &
|
17
|
+
requirement: &2157342620 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2157342620
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: redis_backed_model
|
28
|
-
requirement: &
|
28
|
+
requirement: &2157342120 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '1.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2157342120
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: gem_configurator
|
39
|
-
requirement: &
|
39
|
+
requirement: &2157341620 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '1.2'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2157341620
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: csv_to_object
|
50
|
-
requirement: &
|
50
|
+
requirement: &2157341160 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: '1.0'
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2157341160
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: redis_pipeline
|
61
|
-
requirement: &
|
61
|
+
requirement: &2157340700 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: '1.0'
|
67
67
|
type: :runtime
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *2157340700
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: aws-s3
|
72
|
-
requirement: &
|
72
|
+
requirement: &2157340240 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
@@ -77,7 +77,7 @@ dependencies:
|
|
77
77
|
version: 0.6.3
|
78
78
|
type: :runtime
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *2157340240
|
81
81
|
description: Creates objects, converts them to Redis commands and executes the redis
|
82
82
|
commands.
|
83
83
|
email:
|
@@ -100,9 +100,12 @@ files:
|
|
100
100
|
- lib/generators/redis_importer/install/install_generator.rb
|
101
101
|
- lib/generators/redis_importer/install/templates/redis_importer.example.yml
|
102
102
|
- lib/generators/redis_importer/install/templates/s3_collection.example.yml
|
103
|
+
- lib/railtie.rb
|
103
104
|
- lib/redis_importer.rb
|
104
105
|
- lib/redis_importer/redis_importer.rb
|
106
|
+
- lib/redis_importer/tasks.rb
|
105
107
|
- lib/redis_importer/version.rb
|
108
|
+
- lib/tasks/redis_importer.rake
|
106
109
|
- redis_importer.gemspec
|
107
110
|
- spec/redis_importer_spec.rb
|
108
111
|
- spec/spec_helper.rb
|