redis_importer 0.0.3 → 0.0.4

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.
@@ -1,9 +1,9 @@
1
1
  class S3Collection
2
2
  def initialize
3
- credentials = YAML.load_file(File.open('config/s3_credentials.yml'))['development']
4
- connection = AWS::S3::Base.establish_connection! credentials['connection']
3
+ configuration = YAML.load_file(File.open('config/s3_config.yml'))['development']
4
+ connection = AWS::S3::Base.establish_connection! configuration['connection']
5
5
 
6
- bucket_name = credentials['bucket']
6
+ bucket_name = configuration['bucket']
7
7
  Bucket.create(bucket_name)
8
8
  @bucket = Bucket.find(bucket_name)
9
9
  end
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Installs the necessary configuration files based upon your file storage type. Currently only supports the file storage type 's3'.
3
+
4
+ Example:
5
+ rails generate redis_import s3
6
+
7
+ This will create:
8
+ config/redis_importer.yml
9
+ config/s3_config.yml
@@ -0,0 +1,14 @@
1
+ module RedisImporter
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("../templates", __FILE__)
5
+ argument :file_storage_type, :type => :string
6
+
7
+ def generate_collection
8
+ copy_file "redis_importer.example.yml", "config/redis_importer.yml"
9
+ file_basename = "#{file_storage_type.downcase}_config"
10
+ copy_file "#{file_basename}.example.yml", "config/#{file_basename}.yml"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module RedisImporter
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-08-24 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &2152386960 !ruby/object:Gem::Requirement
16
+ requirement: &2164269120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2152386960
24
+ version_requirements: *2164269120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: gem_configurator
27
- requirement: &2152386540 !ruby/object:Gem::Requirement
27
+ requirement: &2164268700 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2152386540
35
+ version_requirements: *2164268700
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: csv_to_object
38
- requirement: &2152386120 !ruby/object:Gem::Requirement
38
+ requirement: &2164268280 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2152386120
46
+ version_requirements: *2164268280
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: redis_pipeline
49
- requirement: &2152385700 !ruby/object:Gem::Requirement
49
+ requirement: &2164267860 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2152385700
57
+ version_requirements: *2164267860
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: aws-s3
60
- requirement: &2152385200 !ruby/object:Gem::Requirement
60
+ requirement: &2164267360 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 0.6.3
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2152385200
68
+ version_requirements: *2164267360
69
69
  description: Creates objects, converts them to Redis commands and executes the redis
70
70
  commands.
71
71
  email:
@@ -83,13 +83,13 @@ files:
83
83
  - config/.gitignore
84
84
  - lib/collections/S3_collection.rb
85
85
  - lib/extensions/s3.rb
86
- - lib/generators/collection_generator.rb
87
- - lib/generators/redis_importer_generator.rb
86
+ - lib/generators/redis_importer/install/USAGE
87
+ - lib/generators/redis_importer/install/install_generator.rb
88
+ - lib/generators/redis_importer/install/templates/redis_importer.example.yml
89
+ - lib/generators/redis_importer/install/templates/s3_config.example.yml
88
90
  - lib/redis_importer.rb
89
91
  - lib/redis_importer/redis_importer.rb
90
92
  - lib/redis_importer/version.rb
91
- - lib/templates/redis_importer.example.yml
92
- - lib/templates/s3_collection.example.yml
93
93
  - redis_importer.gemspec
94
94
  - spec/redis_importer_spec.rb
95
95
  - spec/spec_helper.rb
@@ -1,11 +0,0 @@
1
- class CollectionGenerator < Rails::Generators::Base
2
- source_root File.expand_path("../../templates", __FILE__)
3
- argument :collection_type, :type => :string, :default => "s3"
4
-
5
- def generate_collection
6
- collection_basename = "#{collection_type.downcase}_collection"
7
- if File.exists?("#{collection_basename}.example.yml")
8
- copy_file "#{collection_basename}.example.yml", "config/#{collection_basename}.yml"
9
- end
10
- end
11
- end
@@ -1,7 +0,0 @@
1
- class RedisImporterGenerator < Rails::Generators::Base
2
- source_root File.expand_path("../../templates", __FILE__)
3
-
4
- def generate_collection
5
- copy_file "redis_importer.example.yml", "config/redis_importer.yml"
6
- end
7
- end