dumpster 0.2.0 → 0.3.0
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.
- data/.gitignore +2 -2
- data/.ruby-version +1 -0
- data/.travis.yml +4 -0
- data/CONTRIBUTING.md +5 -0
- data/README.md +26 -8
- data/lib/dumpster/model/sql.rb +3 -3
- data/lib/dumpster/version.rb +1 -1
- data/spec/integration/csv/output/.gitkeep +0 -0
- data/spec/integration/excel/output/.gitkeep +0 -0
- data/spec/unit/dumpster_spec.rb +1 -1
- metadata +16 -3
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3-p374
|
data/.travis.yml
ADDED
data/CONTRIBUTING.md
ADDED
data/README.md
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
# Dumpster
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
[](https://codeclimate.com/github/garaio/dumpster)
|
4
|
+
[](https://travis-ci.org/senny/dumpster)
|
5
|
+
|
6
|
+
Abstraction layer to export tabular data. Currently dumpster supports XLSX and CSV exports.
|
5
7
|
|
6
8
|
## Installation
|
7
9
|
|
8
10
|
Add this line to your application's Gemfile:
|
9
11
|
|
10
|
-
|
12
|
+
```ruby
|
13
|
+
gem 'dumpster'
|
14
|
+
```
|
11
15
|
|
12
16
|
Or install it yourself as:
|
13
17
|
|
@@ -26,10 +30,24 @@ writer = Dumpster.excel_writer(model)
|
|
26
30
|
writer.write_to_file('/some/directory/some.file')
|
27
31
|
```
|
28
32
|
|
33
|
+
### ActiveRecord
|
34
|
+
|
35
|
+
Dumpster ships with a `Dumpster::Model::ActiveRecordSql`. This model
|
36
|
+
allows you to execute arbitrary SQL through ActiveRecord to export the
|
37
|
+
result.
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
model = Dumpster::Model::ActiveRecordSql.new('SELECT * from users')
|
41
|
+
|
42
|
+
writer = Dumpster.csv_writer(model) # for CSV output
|
43
|
+
writer = Dumpster.excel_writer(model) # for Excel output
|
44
|
+
|
45
|
+
writer.write_to_file('/some/directory/some.file')
|
46
|
+
```
|
47
|
+
|
29
48
|
## Contributing
|
30
49
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
5. Create new Pull Request
|
50
|
+
Please read the [contribution guidelines](CONTRIBUTING.md) before
|
51
|
+
submitting code.
|
52
|
+
|
53
|
+
[](http://githalytics.com/senny/dumpster)
|
data/lib/dumpster/model/sql.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module Dumpster
|
2
2
|
module Model
|
3
|
-
class
|
3
|
+
class ActiveRecordSql
|
4
4
|
|
5
|
-
def initialize(
|
6
|
-
@connection = connection
|
5
|
+
def initialize(sql, connection = ActiveRecord::Base.connection)
|
7
6
|
@sql = sql
|
7
|
+
@connection = connection
|
8
8
|
end
|
9
9
|
|
10
10
|
def each(&block)
|
data/lib/dumpster/version.rb
CHANGED
File without changes
|
File without changes
|
data/spec/unit/dumpster_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dumpster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -67,6 +67,9 @@ extensions: []
|
|
67
67
|
extra_rdoc_files: []
|
68
68
|
files:
|
69
69
|
- .gitignore
|
70
|
+
- .ruby-version
|
71
|
+
- .travis.yml
|
72
|
+
- CONTRIBUTING.md
|
70
73
|
- Gemfile
|
71
74
|
- LICENSE
|
72
75
|
- README.md
|
@@ -78,7 +81,9 @@ files:
|
|
78
81
|
- lib/dumpster/model/generic.rb
|
79
82
|
- lib/dumpster/model/sql.rb
|
80
83
|
- lib/dumpster/version.rb
|
84
|
+
- spec/integration/csv/output/.gitkeep
|
81
85
|
- spec/integration/csv/writer_spec.rb
|
86
|
+
- spec/integration/excel/output/.gitkeep
|
82
87
|
- spec/integration/excel/writer_spec.rb
|
83
88
|
- spec/integration/spec_helper.rb
|
84
89
|
- spec/unit/dumpster_spec.rb
|
@@ -97,20 +102,28 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
97
102
|
- - ! '>='
|
98
103
|
- !ruby/object:Gem::Version
|
99
104
|
version: '0'
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
hash: 3773141393368528094
|
100
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
109
|
none: false
|
102
110
|
requirements:
|
103
111
|
- - ! '>='
|
104
112
|
- !ruby/object:Gem::Version
|
105
113
|
version: '0'
|
114
|
+
segments:
|
115
|
+
- 0
|
116
|
+
hash: 3773141393368528094
|
106
117
|
requirements: []
|
107
118
|
rubyforge_project:
|
108
|
-
rubygems_version: 1.8.
|
119
|
+
rubygems_version: 1.8.23
|
109
120
|
signing_key:
|
110
121
|
specification_version: 3
|
111
122
|
summary: Dumpster kann aufbereitete Daten in verschiedenen Formaten ausgeben
|
112
123
|
test_files:
|
124
|
+
- spec/integration/csv/output/.gitkeep
|
113
125
|
- spec/integration/csv/writer_spec.rb
|
126
|
+
- spec/integration/excel/output/.gitkeep
|
114
127
|
- spec/integration/excel/writer_spec.rb
|
115
128
|
- spec/integration/spec_helper.rb
|
116
129
|
- spec/unit/dumpster_spec.rb
|