julia_builder 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/.travis.yml +1 -1
- data/README.md +2 -1
- data/lib/julia/builder.rb +4 -4
- data/lib/julia/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4acd213b42485fedcdcd46ed594a390387cdc90d
|
4
|
+
data.tar.gz: 1d254d0b7c1beca6a43811da5cfd46bd91285d27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11f69aad0a192ac4df949ce259ab29e5f68429000de3f16b8417a08abc9d45ccf0f61b374107f51f4f72ebe29568762585a4eed0c8bf366520d7f0512ed43b1f
|
7
|
+
data.tar.gz: d3b097cab2477b8b6c1e5d79216cf4c77417a4a52d7e88bc257721e4384a48ad85d136f0000bad481cc64f52b7a2c7c336ef08fb5b902aa356cce7f5125f0136
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.2.2
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# Julia Builder
|
2
|
+
[](https://travis-ci.org/stevenbarragan/julia_builder)
|
2
3
|
|
3
4
|
Julia helps you out to create flexible builders to easily export your queries to csv (for now).
|
4
5
|
|
@@ -50,7 +51,7 @@ users = User.all
|
|
50
51
|
UserCsv.new(users).build(<csv options>)
|
51
52
|
```
|
52
53
|
|
53
|
-
Csv opions could be anything [CSV::new](http://ruby-doc.org/stdlib-2.0.0/libdoc/csv/rdoc/CSV.html) understands, but they are optional.
|
54
|
+
Csv opions could be anything [CSV::new](http://ruby-doc.org/stdlib-2.0.0/libdoc/csv/rdoc/CSV.html#method-c-new) understands, but they are optional.
|
54
55
|
|
55
56
|
3.- Enjoy
|
56
57
|
|
data/lib/julia/builder.rb
CHANGED
@@ -2,10 +2,10 @@ require 'csv'
|
|
2
2
|
|
3
3
|
module Julia
|
4
4
|
class Builder
|
5
|
-
attr_reader :collection
|
5
|
+
attr_reader :collection, :csv_options
|
6
6
|
|
7
|
-
def initialize(collection)
|
8
|
-
@collection = collection
|
7
|
+
def initialize(collection, csv_options = Hash.new)
|
8
|
+
@collection, @csv_options = collection, csv_options
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.columns
|
@@ -17,7 +17,7 @@ module Julia
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def build
|
20
|
-
CSV.generate do |csv|
|
20
|
+
CSV.generate(csv_options) do |csv|
|
21
21
|
csv << columns.keys
|
22
22
|
|
23
23
|
collection.each do |record|
|
data/lib/julia/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: julia_builder
|
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
|
- Steven Barragán
|
@@ -61,6 +61,7 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
63
|
- ".rspec"
|
64
|
+
- ".ruby-version"
|
64
65
|
- ".travis.yml"
|
65
66
|
- CODE_OF_CONDUCT.md
|
66
67
|
- Gemfile
|
@@ -93,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
94
|
version: '0'
|
94
95
|
requirements: []
|
95
96
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.
|
97
|
+
rubygems_version: 2.4.5
|
97
98
|
signing_key:
|
98
99
|
specification_version: 4
|
99
100
|
summary: Export your queries easily and fast
|