awesome_imports 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,14 +3,6 @@ module AwesomeImports
3
3
  module CsvImportsController
4
4
  extend ActiveSupport::Concern
5
5
 
6
- included do
7
- cattr_reader :object_name, :import_name, :resource_class
8
-
9
- @@object_name = self.name.underscore.split('_').first # "keyword"
10
- @@import_name = [object_name, "import"].join('_') # "keyword_import"
11
- @@resource_class = import_name.classify.constantize # KeywordImport
12
- end
13
-
14
6
  module InstanceMethods
15
7
 
16
8
  def new
@@ -39,10 +31,33 @@ module AwesomeImports
39
31
  render :create
40
32
  end
41
33
  end
34
+
35
+ private
36
+ def object_name
37
+ self.class.object_name
38
+ end
39
+
40
+ def import_name
41
+ self.class.import_name
42
+ end
43
+
44
+ def resource_class
45
+ self.class.resource_class
46
+ end
42
47
  end
43
48
 
44
49
  module ClassMethods
45
- end
50
+ def object_name
51
+ self.name.underscore.split('_').first # "keyword"
52
+ end
46
53
 
54
+ def import_name
55
+ [object_name, "import"].join('_') # "keyword_import"
56
+ end
57
+
58
+ def resource_class
59
+ import_name.classify.constantize # KeywordImport
60
+ end
61
+ end
47
62
  end
48
63
  end
@@ -1,3 +1,3 @@
1
1
  module AwesomeImports
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: awesome_imports
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:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-22 00:00:00.000000000 +09:00
12
+ date: 2011-11-28 00:00:00.000000000 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
17
- requirement: &2157453280 !ruby/object:Gem::Requirement
17
+ requirement: &2154491780 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2157453280
25
+ version_requirements: *2154491780
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activemodel
28
- requirement: &2157452760 !ruby/object:Gem::Requirement
28
+ requirement: &2154491020 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 3.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2157452760
36
+ version_requirements: *2154491020
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: activerecord
39
- requirement: &2157452280 !ruby/object:Gem::Requirement
39
+ requirement: &2154489800 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 3.0.0
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *2157452280
47
+ version_requirements: *2154489800
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: actionpack
50
- requirement: &2157451800 !ruby/object:Gem::Requirement
50
+ requirement: &2154489320 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 3.0.0
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *2157451800
58
+ version_requirements: *2154489320
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rake
61
- requirement: &2157451320 !ruby/object:Gem::Requirement
61
+ requirement: &2154488820 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *2157451320
69
+ version_requirements: *2154488820
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec
72
- requirement: &2157450840 !ruby/object:Gem::Requirement
72
+ requirement: &2154488120 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,7 +77,7 @@ dependencies:
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *2157450840
80
+ version_requirements: *2154488120
81
81
  description: Cool and simple data importer for rails by CSV
82
82
  email:
83
83
  - matsumura.aki@gmail.com
@@ -113,12 +113,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  - - ! '>='
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
+ segments:
117
+ - 0
118
+ hash: -155471752393116530
116
119
  required_rubygems_version: !ruby/object:Gem::Requirement
117
120
  none: false
118
121
  requirements:
119
122
  - - ! '>='
120
123
  - !ruby/object:Gem::Version
121
124
  version: '0'
125
+ segments:
126
+ - 0
127
+ hash: -155471752393116530
122
128
  requirements: []
123
129
  rubyforge_project: awesome_imports
124
130
  rubygems_version: 1.6.2