ftpmvc 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ftpmvc/formats/csv.rb +6 -2
- data/lib/ftpmvc/version.rb +1 -1
- data/spec/lib/ftpmvc/formats/csv_spec.rb +4 -4
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7abd0e2a3bd146744e6bf6e96965d4745ba84bc7
|
4
|
+
data.tar.gz: 2e079a93d919b52c2529de70de3a9bc7970594f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 905e09c15e88c3267783b00f2e151eb5b2b8c5194366f9b38b0dbdca1b38833771c19e54ca918efdceb3059f82a4cf4274ba8a15b5f1e6cc9833b79feedfdcff
|
7
|
+
data.tar.gz: 4b8272c171aaffb33c6df2a18b0336d035d04a3ffc4cefd0eefd47fdc33268d06a9214f78ab62f71d7af003e04f0cc0449a25e65417632895da9d51e7d8b8bb4
|
data/lib/ftpmvc/formats/csv.rb
CHANGED
@@ -15,14 +15,18 @@ module FTPMVC
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def data
|
18
|
+
StringIO.new(csv)
|
19
|
+
end
|
20
|
+
|
21
|
+
protected
|
22
|
+
|
23
|
+
def csv
|
18
24
|
::CSV.generate do |csv|
|
19
25
|
csv << header if header.present?
|
20
26
|
rows.each { |row| csv << row.to_a.map { |f| format(f) } }
|
21
27
|
end
|
22
28
|
end
|
23
29
|
|
24
|
-
protected
|
25
|
-
|
26
30
|
def format(field)
|
27
31
|
self.class.format(field)
|
28
32
|
end
|
data/lib/ftpmvc/version.rb
CHANGED
@@ -15,7 +15,7 @@ describe FTPMVC::Formats::CSV do
|
|
15
15
|
let(:csv_file) { csv_file_class.new('test') }
|
16
16
|
describe '#data' do
|
17
17
|
it 'is a CSV string based on #rows' do
|
18
|
-
expect(csv_file.data).to eq "a,b,c\nd,e,f\n"
|
18
|
+
expect(csv_file.data.read).to eq "a,b,c\nd,e,f\n"
|
19
19
|
end
|
20
20
|
context 'when #rows is not an array of arrays' do
|
21
21
|
before do
|
@@ -24,7 +24,7 @@ describe FTPMVC::Formats::CSV do
|
|
24
24
|
allow(csv_file).to receive(:rows).and_return([row])
|
25
25
|
end
|
26
26
|
it 'firstly converts that' do
|
27
|
-
expect(csv_file.data).to eq "q,w,e\n"
|
27
|
+
expect(csv_file.data.read).to eq "q,w,e\n"
|
28
28
|
end
|
29
29
|
end
|
30
30
|
context 'when #headers is defined' do
|
@@ -32,7 +32,7 @@ describe FTPMVC::Formats::CSV do
|
|
32
32
|
allow(csv_file).to receive(:header).and_return(['X', 'Y', 'Z'])
|
33
33
|
end
|
34
34
|
it 'uses it on first line' do
|
35
|
-
expect(csv_file.data).to eq "X,Y,Z\na,b,c\nd,e,f\n"
|
35
|
+
expect(csv_file.data.read).to eq "X,Y,Z\na,b,c\nd,e,f\n"
|
36
36
|
end
|
37
37
|
end
|
38
38
|
context 'when date_format is defined' do
|
@@ -46,7 +46,7 @@ describe FTPMVC::Formats::CSV do
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
it 'formats dates' do
|
49
|
-
expect(csv_file.data).to eq "01/01/11\n"
|
49
|
+
expect(csv_file.data.read).to eq "01/01/11\n"
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ftpmvc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Aizim Kelmanson
|
@@ -14,98 +14,98 @@ dependencies:
|
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.6'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: guard-rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: terminal-notifier-guard
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: codeclimate-test-reporter
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: em-ftpd
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: activesupport
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
description: FTP MVC framework
|
@@ -115,9 +115,9 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
-
- .gitignore
|
119
|
-
- .rspec
|
120
|
-
- .travis.yml
|
118
|
+
- ".gitignore"
|
119
|
+
- ".rspec"
|
120
|
+
- ".travis.yml"
|
121
121
|
- Gemfile
|
122
122
|
- Guardfile
|
123
123
|
- LICENSE.txt
|
@@ -157,12 +157,12 @@ require_paths:
|
|
157
157
|
- lib
|
158
158
|
required_ruby_version: !ruby/object:Gem::Requirement
|
159
159
|
requirements:
|
160
|
-
- -
|
160
|
+
- - ">="
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
|
-
- -
|
165
|
+
- - ">="
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|