to-arff 0.1.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c8f5bf9d47e8b08b212f1650e2b12b2647ab9601
4
+ data.tar.gz: 16c1b59047d553bbb377e99731e39ef05cd45a92
5
+ SHA512:
6
+ metadata.gz: 1567a0445623ea82d463a45d4f2cec3eb22ace2be1d104c6fb2609c58a67b3253eba953eaf7d4092c36bc08088a7abd73668ef61d85226342e7f35d425fda76e
7
+ data.tar.gz: cb752aa8e4f5b186cee9aab3f72bb4658b883a1bdfee6e88122d66d6a2beb0b180f7347c1518cab82a968b0480adb54b0ddb98b11c7d36f9717d8ef3ae09e493
@@ -0,0 +1 @@
1
+ service_name: travis-ci
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,11 @@
1
+ cache: bundler
2
+ language: ruby
3
+ rvm:
4
+ - 2.2
5
+
6
+ before_install:
7
+ - gem update --system
8
+ - gem --version
9
+ - gem install bundler
10
+
11
+ script: 'bundle exec rspec spec'
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at dhrubo_moy@yahoo.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in to-arff.gemspec
4
+ gemspec
5
+
6
+ gem 'coveralls', require: false
@@ -0,0 +1,70 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Note: The cmd option is now required due to the increasing number of ways
19
+ # rspec may be run, below are examples of the most common uses.
20
+ # * bundler: 'bundle exec rspec'
21
+ # * bundler binstubs: 'bin/rspec'
22
+ # * spring: 'bin/rspec' (This will use spring if running and you have
23
+ # installed the spring binstubs per the docs)
24
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
25
+ # * 'just' rspec: 'rspec'
26
+
27
+ guard :rspec, cmd: "bundle exec rspec" do
28
+ require "guard/rspec/dsl"
29
+ dsl = Guard::RSpec::Dsl.new(self)
30
+
31
+ # Feel free to open issues for suggestions and improvements
32
+
33
+ # RSpec files
34
+ rspec = dsl.rspec
35
+ watch(rspec.spec_helper) { rspec.spec_dir }
36
+ watch(rspec.spec_support) { rspec.spec_dir }
37
+ watch(rspec.spec_files)
38
+
39
+ # Ruby files
40
+ ruby = dsl.ruby
41
+ dsl.watch_spec_files_for(ruby.lib_files)
42
+
43
+ # Rails files
44
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
45
+ dsl.watch_spec_files_for(rails.app_files)
46
+ dsl.watch_spec_files_for(rails.views)
47
+
48
+ watch(rails.controllers) do |m|
49
+ [
50
+ rspec.spec.call("routing/#{m[1]}_routing"),
51
+ rspec.spec.call("controllers/#{m[1]}_controller"),
52
+ rspec.spec.call("acceptance/#{m[1]}")
53
+ ]
54
+ end
55
+
56
+ # Rails config changes
57
+ watch(rails.spec_helper) { rspec.spec_dir }
58
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
59
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
60
+
61
+ # Capybara features specs
62
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
63
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
64
+
65
+ # Turnip features and steps
66
+ watch(%r{^spec/acceptance/(.+)\.feature$})
67
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
68
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
69
+ end
70
+ end
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Dhrubomoy Das Gupta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,152 @@
1
+ # ToARFF
2
+ ##Table of Content
3
+ - [About](#about)
4
+ - [What is an ARFF File](#what-is-an-arff-file)
5
+ - [Installation](#installation)
6
+ - [Usage](#usage)
7
+ - [Convert from an SQLite Database](#convert-from-an-sqlite-database)
8
+ - [Contributing](#contributing)
9
+ - [License](#license)
10
+
11
+ ## About
12
+ ToARFF is a ruby library to convert SQLite database files to ARFF files (Attribute-Relation File Format), which is used to specify datasets for WEKA, a machine learning and data mining tool.
13
+
14
+ ### What is an ARFF File:
15
+ [This wiki](http://weka.wikispaces.com/ARFF+%28book+version%29 ) describes perfectly,
16
+ "An ARFF (Attribute-Relation File Format) file is an ASCII text file that describes a list of instances sharing a set of attributes. ARFF files were developed by the Machine Learning Project at the Department of Computer Science of The University of Waikato for use with the Weka machine learning software."
17
+
18
+ **Note:** Converting from an SQLite database will generate one ARFF file per table. See [this stackoverflow post](http://stackoverflow.com/questions/37009995/weka-machine-learning-arff-file-multiple-relations).
19
+
20
+ ## Installation
21
+
22
+ Add this line to your application's Gemfile:
23
+
24
+ ```ruby
25
+ gem 'to-arff'
26
+ ```
27
+
28
+ And then execute:
29
+
30
+ $ bundle
31
+
32
+ Or install it yourself as:
33
+
34
+ $ gem install to-arff
35
+
36
+ ## Usage
37
+
38
+ ###Convert from an SQLite Database
39
+ #### By Specifying Column Types (Recommended)
40
+ Its better to specify column types.
41
+ ```ruby
42
+ require 'to-arff'
43
+ # You can download the file from '/spec /sample_db_files/sample2.db'
44
+ sample = ToARFF::SQLiteDB.new "/path/to/sample_sqlite.db"
45
+ # Attribute names and types must be valid
46
+ # eg. { "table1" => {"column11"=>"NUMERIC",
47
+ # "column12"=>"STRING"
48
+ # },
49
+ # "table2" => {"column21"=>"class {Iris-setosa,Iris-versicolor,Iris-virginica}",
50
+ # "column22"=>"DATE \"yyyy-MM-dd HH:mm:ss\""
51
+ # }
52
+ sample_column_types_param = { "employees" => {"EmployeeId"=>"NUMERIC",
53
+ "LastName"=>"STRING",
54
+ "City"=>"STRING",
55
+ "HireDate"=>"DATE \"yyyy-MM-dd HH:mm:ss\""
56
+ },
57
+ "albums" => { "Albumid"=>"NUMERIC",
58
+ "Title"=>"STRING"
59
+ }
60
+ }
61
+ puts sample.convert column_types: sample_column_types_param
62
+ ```
63
+ We will get something similar to following:
64
+ ```
65
+ @RELATION employees
66
+
67
+ @ATTRIBUTE EmployeeId NUMERIC
68
+ @ATTRIBUTE LastName STRING
69
+ @ATTRIBUTE City STRING
70
+ @ATTRIBUTE HireDate DATE "yyyy-MM-dd HH:mm:ss"
71
+
72
+ @DATA
73
+ 1,"Adams","Edmonton","2002-08-14 00:00:00"
74
+ 2,"Edwards","Calgary","2002-05-01 00:00:00"
75
+ 3,"Peacock","Calgary","2002-04-01 00:00:00"
76
+ ...and so on...
77
+
78
+ @RELATION albums
79
+
80
+ @ATTRIBUTE Albumid NUMERIC
81
+ @ATTRIBUTE Title STRING
82
+
83
+ @DATA
84
+ 1,"For Those About To Rock We Salute You"
85
+ 2,"Balls to the Wall"
86
+ 3,"Restless and Wild"
87
+ ...and so on...
88
+ ```
89
+
90
+ #### By Specifying Column Names
91
+ ```ruby
92
+ require 'to-arff'
93
+ sample = ToARFF::SQLiteDB.new "/path/to/sample_sqlite.db"
94
+ sample_columns = { "albums" => ["AlbumId", "Title", "ArtistId"],
95
+ "employees" => ["EmployeeId", "LastName", "FirstName", "Title"]
96
+ }
97
+ puts sample.convert columns: sample_columns
98
+ ```
99
+ We will get something similar:
100
+ ```
101
+ @RELATION albums
102
+
103
+ @ATTRIBUTE AlbumId NUMERIC
104
+ @ATTRIBUTE Title STRING
105
+ @ATTRIBUTE ArtistId NUMERIC
106
+
107
+ @DATA
108
+ 1,"For Those About To Rock We Salute You",1
109
+ 2,"Balls to the Wall",2
110
+ ...and so on...
111
+
112
+
113
+
114
+ @RELATION employees
115
+
116
+ @ATTRIBUTE EmployeeId NUMERIC
117
+ @ATTRIBUTE LastName STRING
118
+ @ATTRIBUTE FirstName STRING
119
+ @ATTRIBUTE HireDate STRING
120
+
121
+ @DATA
122
+ 1,"Adams","Andrew","2002-08-14 00:00:00"
123
+ 2,"Edwards","Nancy","2002-05-01 00:00:00"
124
+ ...and so on..
125
+ ```
126
+ As you can see, "HireDate" Attribute didn't have the correct datatype. It should be "DATE "yyyy-MM-dd HH:mm:ss"", not "STRING"
127
+
128
+ #### You can also do following, but might not generate correct datatypes
129
+ ```ruby
130
+ require 'to-arff'
131
+ sample = ToARFF::SQLiteDB.new "/path/to/sample_sqlite.db"
132
+ sample.convert tables: ["albums","employees"]
133
+ # OR
134
+ sample.convert
135
+ ```
136
+
137
+ ## Contributing
138
+
139
+ Bug reports and pull requests are welcome on GitHub at https://github.com/dhrubomoy/to-arff. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
140
+
141
+ 1. Fork it ( https://github.com/dhrubomoy/to-arff/fork )
142
+ 2. Create branch (`git checkout -b my-new-feature`)
143
+ 3. Make changes. Add test cases for your changes
144
+ 4. Run `rspec spec/` and make sure all the test passes
145
+ 5. Commit your changes (`git commit -am 'Add some feature'`)
146
+ 6. Push to the branch (`git push origin my-new-feature`)
147
+ 7. Create new Pull Request
148
+
149
+
150
+ ## License
151
+
152
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "to-arff"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,6 @@
1
+ require "to-arff/version"
2
+
3
+ module ToARFF
4
+ class ToARFF
5
+ end
6
+ end
@@ -0,0 +1,215 @@
1
+ require "to-arff/version"
2
+ require 'sqlite3'
3
+
4
+ module ToARFF
5
+
6
+ RELATION_MARKER = '@RELATION'
7
+ ATTRIBUTE_MARKER = '@ATTRIBUTE'
8
+ DATA_MARKER = '@DATA'
9
+
10
+ ATTRIBUTE_TYPE_NUMERIC = 'NUMERIC'
11
+ ATTRIBUTE_TYPE_STRING = 'STRING'
12
+
13
+
14
+ class SQLiteDB
15
+
16
+ attr_accessor :db_file_path, :db, :tables, :columns, :column_type
17
+
18
+ def initialize(path)
19
+ @db_file_path = path
20
+ @tables = Array.new
21
+ @columns = Hash.new
22
+ @column_type = Hash.new
23
+ process_db_file
24
+ set_all_tables
25
+ set_all_columns
26
+ end
27
+
28
+ def process_db_file
29
+ if @db_file_path != ''
30
+ if File.exist? "#{@db_file_path}"
31
+ begin
32
+ @db = SQLite3::Database.open "#{@db_file_path}"
33
+ rescue SQLite3::Exception => e
34
+ puts "#{e}"
35
+ end
36
+ else
37
+ raise "#{@db_file_path} doesn't exist. Enter a valid file path."
38
+ end
39
+ else
40
+ raise "Database File Path cannot be empty."
41
+ end
42
+ end
43
+
44
+ # Get all the tables' name and store them in an array (@tables).
45
+ def set_all_tables
46
+ begin
47
+ tables_arr = @db.execute("SELECT name FROM sqlite_master WHERE type='table';")
48
+ tables_arr.each do |elem|
49
+ @tables.push(elem.first)
50
+ end
51
+ rescue SQLite3::Exception => e
52
+ puts "#{e}"
53
+ end
54
+ end
55
+
56
+ # Get all colums for a given table.
57
+ def get_columns(table_name)
58
+ columns_arr = Array.new
59
+ begin
60
+ pst = @db.prepare "SELECT * FROM #{table_name} LIMIT 6"
61
+ pst.columns.each do |c|
62
+ columns_arr.push(c)
63
+ end
64
+ columns_arr
65
+ rescue SQLite3::Exception => e
66
+ puts e
67
+ end
68
+ end
69
+
70
+ def set_all_columns
71
+ @tables.each do |t|
72
+ @columns[t] = get_columns(t)
73
+ end
74
+ end
75
+
76
+ # If the column type is nominal return true.
77
+ def is_numeric(table_name, column_name)
78
+ begin
79
+ if @db.execute("SELECT #{column_name} from #{table_name} LIMIT 1").first.first.is_a? Numeric
80
+ return true
81
+ else
82
+ return false
83
+ end
84
+ rescue SQLite3::Exception => e
85
+ puts e
86
+ end
87
+ end
88
+
89
+ # Converts a table to ARFF.
90
+ def convert_table(table_name)
91
+ convert_table_with_columns(table_name, get_columns(table_name))
92
+ end
93
+
94
+ def convert_table_with_columns(table_name, columns, column_types=nil)
95
+ rel = "#{RELATION_MARKER} #{table_name}\n\n"
96
+ if column_types.nil?
97
+ columns.each do |col|
98
+ if is_numeric(table_name, col)
99
+ rel << "#{ATTRIBUTE_MARKER} #{col} #{ATTRIBUTE_TYPE_NUMERIC}\n"
100
+ else
101
+ rel << "#{ATTRIBUTE_MARKER} #{col} #{ATTRIBUTE_TYPE_STRING}\n"
102
+ end
103
+ end
104
+ else
105
+ columns.each do |col|
106
+ rel << "#{ATTRIBUTE_MARKER} #{col} #{column_types[table_name][col]}\n"
107
+ end
108
+ end
109
+ columns_str = ""
110
+ columns.each do |col|
111
+ columns_str += col + ", "
112
+ end
113
+ columns_str = columns_str.chomp(", ")
114
+ rel << "\n#{DATA_MARKER}\n"
115
+ data = @db.prepare "SELECT #{columns_str} FROM #{table_name}"
116
+ data.each do |elem|
117
+ row = ""
118
+ elem.each do |val|
119
+ if val.is_a? Numeric
120
+ row = row + "#{val}" + ","
121
+ else
122
+ row = row + "\"#{val}\"" + ","
123
+ end
124
+ end
125
+ rel << row.strip.chomp(",")
126
+ rel << "\n"
127
+ end
128
+ rel << "\n\n\n"
129
+ rel
130
+ end
131
+
132
+ def convert_from_columns_hash(cols_hash)
133
+ rel = ""
134
+ cols_hash.keys.each do |table|
135
+ rel << convert_table_with_columns(table, cols_hash[table])
136
+ end
137
+ rel
138
+ end
139
+
140
+ def convert_from_column_types_hash(col_types_hash)
141
+ rel = ""
142
+ col_types_hash.keys.each do |table|
143
+ rel << convert_table_with_columns(table, col_types_hash[table].keys, col_types_hash)
144
+ end
145
+ rel
146
+ end
147
+
148
+ def check_given_tables_validity(given_tables)
149
+ dif = downcase_array(given_tables) - downcase_array(@tables)
150
+ if !dif.empty? # If @tables doesn't contain all elements of given_tables
151
+ raise ArgumentError.new("\"#{dif.first}\" does not exist.")
152
+ end
153
+ end
154
+
155
+ def check_given_columns_validity(given_columns)
156
+ given_tables = given_columns.keys
157
+ check_given_tables_validity(given_tables)
158
+ given_tables.each do |elem|
159
+ dif = downcase_array(given_columns[elem]) - downcase_array(@columns[elem])
160
+ if !dif.empty? # If @tables doesn't contain all elements of given_tables
161
+ raise ArgumentError.new("\"#{dif.first}\" does not exist.")
162
+ end
163
+ end
164
+ end
165
+
166
+ def downcase_array(arr)
167
+ downcased_array = Array.new
168
+ arr.each do |elem|
169
+ if elem.is_a? String
170
+ downcased_array.push(elem.downcase)
171
+ elsif elem.is_a? Array
172
+ downcased_array.push(elem.first.downcase)
173
+ end
174
+ end
175
+ downcased_array
176
+ end
177
+
178
+ def convert(options={})
179
+ temp_tables = options.fetch(:tables, Array.new)
180
+ temp_columns = options.fetch(:columns, Hash.new)
181
+ temp_column_types = options.fetch(:column_types, Hash.new)
182
+ res = ""
183
+ param_count = options.keys.length
184
+ if param_count == 0
185
+ @tables.each do |t|
186
+ res << convert_table(t)
187
+ end
188
+ elsif param_count == 1
189
+ if options.keys.first.to_s != "tables" && options.keys.first.to_s != "columns" && options.keys.first.to_s != "column_types"
190
+ raise ArgumentError.new("Wrong parameter name \":#{options.keys.first.to_s}\"")
191
+ else
192
+ if !temp_tables.empty?
193
+ check_given_tables_validity(temp_tables)
194
+ temp_tables.each do |t|
195
+ res << convert_table(t)
196
+ end
197
+ end
198
+ if !temp_columns.keys.empty?
199
+ check_given_columns_validity(temp_columns)
200
+ res << convert_from_columns_hash(temp_columns)
201
+ end
202
+ if !temp_column_types.empty?
203
+ check_given_columns_validity(temp_column_types)
204
+ res << convert_from_column_types_hash(temp_column_types)
205
+ end
206
+ end
207
+ elsif param_count > 1
208
+ raise ArgumentError.new("You can specify only one out of the three parameters: table, columns, column_types.")
209
+ end
210
+ res
211
+ end
212
+
213
+ end
214
+
215
+ end
@@ -0,0 +1,3 @@
1
+ module ToARFF
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'to-arff/version'
5
+ require 'to-arff'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "to-arff"
9
+ spec.version = ToARFF::VERSION
10
+ spec.authors = ["dhrubo_moy"]
11
+ spec.email = ["dhrubo_moy@yahoo.com"]
12
+
13
+ spec.summary = %q{ ToARFF is a ruby gem to convert sqlite database file and csv file to ARFF (Attribute-Relation File Format) file }
14
+ #spec.description = %q{TODO: Write a longer description or delete this line.}
15
+ spec.homepage = "https://github.com/dhrubomoy/to-arff"
16
+ spec.license = "MIT"
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.12"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rspec", "~> 3.0"
26
+ spec.add_development_dependency "sqlite3", "~> 1.3"
27
+ end
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: to-arff
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - dhrubo_moy
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-08-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sqlite3
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ description:
70
+ email:
71
+ - dhrubo_moy@yahoo.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".coveralls.yml"
77
+ - ".gitignore"
78
+ - ".rspec"
79
+ - ".travis.yml"
80
+ - CODE_OF_CONDUCT.md
81
+ - Gemfile
82
+ - Guardfile
83
+ - LICENSE.txt
84
+ - README.md
85
+ - Rakefile
86
+ - bin/console
87
+ - bin/setup
88
+ - lib/to-arff.rb
89
+ - lib/to-arff/sqlitedb.rb
90
+ - lib/to-arff/version.rb
91
+ - to-arff.gemspec
92
+ homepage: https://github.com/dhrubomoy/to-arff
93
+ licenses:
94
+ - MIT
95
+ metadata: {}
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ requirements: []
111
+ rubyforge_project:
112
+ rubygems_version: 2.5.1
113
+ signing_key:
114
+ specification_version: 4
115
+ summary: ToARFF is a ruby gem to convert sqlite database file and csv file to ARFF
116
+ (Attribute-Relation File Format) file
117
+ test_files: []