csv_magic 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/csv_magic.gemspec +2 -1
- data/lib/csv_magic/controller_actions.rb +7 -7
- data/lib/csv_magic/version.rb +1 -1
- metadata +4 -7
data/csv_magic.gemspec
CHANGED
@@ -11,11 +11,12 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = %q{Adds some CSV magic into your app.}
|
12
12
|
s.description = %q{Provides controller actions, views and field mapping for data from a csv file.}
|
13
13
|
s.rubyforge_project = "csv_magic"
|
14
|
+
s.required_ruby_version = '>= 1.9.2'
|
14
15
|
|
15
16
|
s.files = `git ls-files`.split("\n")
|
16
17
|
s.test_files = `git ls-files -- {spec}/*`.split("\n")
|
17
18
|
s.require_paths = ["lib"]
|
18
|
-
|
19
|
+
|
19
20
|
s.add_development_dependency 'rails', ['~> 3.1.4']
|
20
21
|
s.add_development_dependency 'rspec-rails', ["~> 2.8.0"]
|
21
22
|
s.add_development_dependency 'sqlite3', ["~> 1.3.5"]
|
@@ -6,7 +6,7 @@ module CSVMagic
|
|
6
6
|
base.csv_magic_config
|
7
7
|
base.send(:include, I18nHelpers)
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
module ClassMethods
|
11
11
|
def csv_magic_config( options = {} )
|
12
12
|
defaults = {
|
@@ -68,18 +68,18 @@ module CSVMagic
|
|
68
68
|
render 'csv_magic/mapper'
|
69
69
|
end
|
70
70
|
rescue MissingFileContentsError
|
71
|
-
flash[:
|
71
|
+
flash[:error] = csv_magic_t(:please_upload_a_csv_file)
|
72
72
|
render_csv_import_form
|
73
73
|
rescue ::CSV::MalformedCSVError => e
|
74
|
-
flash[:
|
74
|
+
flash[:error] = csv_magic_t(:csv_file_has_wrong_format) % {:error => e.message}
|
75
75
|
render_csv_import_form
|
76
76
|
rescue ::Errno::ENOENT
|
77
|
-
flash[:
|
77
|
+
flash[:error] = csv_magic_t(:file_not_on_server_any_more)
|
78
78
|
render_csv_import_form
|
79
79
|
rescue Exception => e
|
80
|
-
flash[:
|
81
|
-
logger.error(e.message)
|
82
|
-
logger.error(e.backtrace.join("\n"))
|
80
|
+
flash[:error] = "#{e.message[0..100]}..." # Protection from CookieOverflow errors, if large sql queries fail
|
81
|
+
Rails.logger.error(e.message)
|
82
|
+
Rails.logger.error(e.backtrace.join("\n"))
|
83
83
|
render_csv_import_form
|
84
84
|
end
|
85
85
|
|
data/lib/csv_magic/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csv_magic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-11-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -145,10 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
145
|
requirements:
|
146
146
|
- - ! '>='
|
147
147
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
149
|
-
segments:
|
150
|
-
- 0
|
151
|
-
hash: 4559841792512876128
|
148
|
+
version: 1.9.2
|
152
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
150
|
none: false
|
154
151
|
requirements:
|
@@ -157,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
154
|
version: '0'
|
158
155
|
segments:
|
159
156
|
- 0
|
160
|
-
hash:
|
157
|
+
hash: -907811590562575980
|
161
158
|
requirements: []
|
162
159
|
rubyforge_project: csv_magic
|
163
160
|
rubygems_version: 1.8.24
|