arr2hash 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8a83b6913605503eea71e530d485c4ef661236b807c19109bea4d9361e691c24
4
+ data.tar.gz: ba49d2384df4d6258209edb3526a88768a1efb34d52fbd64f97a8aaad7b54eed
5
+ SHA512:
6
+ metadata.gz: 6155e3eb378c213d1e96ba72fb385b0188b32fd426eeb78912edba6476432f4583a9cc1dc31a2cd605a5293ef16d8d35773c54687ccbe055daa2a31cf23f7514
7
+ data.tar.gz: 51e2ffac81de617ae6f56ea48da574013a833d262c24776c837cb5753280fce64e08ecd90082c3d2a91f1c54c6b5e0afd6a54111c2394cd4d4b115d38963adf3
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Arr2hash
2
+
3
+ TODO: Delete this and the text below, and describe your gem
4
+
5
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/arr2hash`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ ## Installation
8
+
9
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
+
11
+ Install the gem and add to the application's Gemfile by executing:
12
+
13
+ $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
14
+
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
16
+
17
+ $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/arr2hash.
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ task default: %i[]
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Arr2hash
4
+ VERSION = "0.1.0"
5
+ end
data/lib/arr2hash.rb ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "arr2hash/version"
4
+
5
+ module Arr2hash
6
+ class Error < StandardError; end
7
+ def self.a_to_hash(array)
8
+ return [] if array.empty?
9
+
10
+ keys = array[0]
11
+ array[1..-1].map do |values|
12
+ Hash[keys.zip(values)]
13
+ end
14
+ end
15
+ end
data/sig/arr2hash.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Arr2hash
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: arr2hash
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - terao_tomohiro_44
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-08-16 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: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
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
+ description: The arr2hash gem provides a simple way to convert a 2D array into an
56
+ array of hashes. The first row of the 2D array is used as the keys, and the subsequent
57
+ rows are converted to values, creating an array of hashes. This is especially useful
58
+ for converting structured data like CSV.
59
+ email:
60
+ - zio.tt.dev@gmail.com
61
+ executables: []
62
+ extensions: []
63
+ extra_rdoc_files: []
64
+ files:
65
+ - ".rspec"
66
+ - README.md
67
+ - Rakefile
68
+ - lib/arr2hash.rb
69
+ - lib/arr2hash/version.rb
70
+ - sig/arr2hash.rbs
71
+ homepage: https://github.com/zio-tt/arr2hash
72
+ licenses: []
73
+ metadata:
74
+ allowed_push_host: https://rubygems.org
75
+ homepage_uri: https://github.com/zio-tt/arr2hash
76
+ source_code_uri: https://github.com/zio-tt/arr2hash
77
+ changelog_uri: https://github.com/zio-tt/arr2hash
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 2.6.0
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubygems_version: 3.4.16
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Converts a 2D array to an array of hashes
97
+ test_files: []