put 0.0.1

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: 833121595321bacc22e213e447580f40bbbe1500670d5072c582ae54624b468f
4
+ data.tar.gz: 07dd91f2ae928542e6d4ed42d046ed628fd6a28ef13978cba7ab811796128d92
5
+ SHA512:
6
+ metadata.gz: 37a54ae5099e675f9819d4f53e754b481d9ed7b8ad10623ca1978a0277f94e61b6acbc4eac6b0949f1a8dd9ea1e780571f4a6e5b655f493f6ecf11f1687c26f9
7
+ data.tar.gz: 568dcf85f64510b6b8d8fedc70adc1740339893413a2dfad8a9f42d4f512a2dbbdf2b344356d0fcd38b4b320dbd09bb939a471e1d384b92078d4a74f37a3d631
data/.standard.yml ADDED
@@ -0,0 +1,3 @@
1
+ # For available configuration options, see:
2
+ # https://github.com/testdouble/standard
3
+ ruby_version: 2.6
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-09-21
4
+
5
+ - Initial release
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in put.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
11
+
12
+ gem "standard", "~> 1.3"
data/Gemfile.lock ADDED
@@ -0,0 +1,50 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ put (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ json (2.6.2)
11
+ minitest (5.16.3)
12
+ parallel (1.22.1)
13
+ parser (3.1.2.1)
14
+ ast (~> 2.4.1)
15
+ rainbow (3.1.1)
16
+ rake (13.0.6)
17
+ regexp_parser (2.5.0)
18
+ rexml (3.2.5)
19
+ rubocop (1.35.1)
20
+ json (~> 2.3)
21
+ parallel (~> 1.10)
22
+ parser (>= 3.1.2.1)
23
+ rainbow (>= 2.2.2, < 4.0)
24
+ regexp_parser (>= 1.8, < 3.0)
25
+ rexml (>= 3.2.5, < 4.0)
26
+ rubocop-ast (>= 1.20.1, < 2.0)
27
+ ruby-progressbar (~> 1.7)
28
+ unicode-display_width (>= 1.4.0, < 3.0)
29
+ rubocop-ast (1.21.0)
30
+ parser (>= 3.1.1.0)
31
+ rubocop-performance (1.14.3)
32
+ rubocop (>= 1.7.0, < 2.0)
33
+ rubocop-ast (>= 0.4.0)
34
+ ruby-progressbar (1.11.0)
35
+ standard (1.16.1)
36
+ rubocop (= 1.35.1)
37
+ rubocop-performance (= 1.14.3)
38
+ unicode-display_width (2.3.0)
39
+
40
+ PLATFORMS
41
+ arm64-darwin-21
42
+
43
+ DEPENDENCIES
44
+ minitest (~> 5.0)
45
+ put!
46
+ rake (~> 13.0)
47
+ standard (~> 1.3)
48
+
49
+ BUNDLED WITH
50
+ 2.3.22
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Test Double, Inc.
4
+ Portions Copyright 2022 Matthew Draper (https://github.com/matthewd)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # Put
2
+
3
+ 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/put`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Install the gem and add to the application's Gemfile by executing:
10
+
11
+ $ bundle add put
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ $ gem install put
16
+
17
+ ## Usage
18
+
19
+ TODO: Write usage instructions here
20
+
21
+ ## Development
22
+
23
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
+
25
+ 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).
26
+
27
+ ## Contributing
28
+
29
+ Bug reports and pull requests are welcome on GitHub at https://github.com/searls/put.
30
+
31
+ ## License
32
+
33
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/test_*.rb"]
10
+ end
11
+
12
+ require "standard/rake"
13
+
14
+ task default: %i[test standard]
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Put
4
+ VERSION = "0.0.1"
5
+ end
data/lib/put.rb ADDED
@@ -0,0 +1,38 @@
1
+ require_relative "put/version"
2
+
3
+ class Put
4
+ def self.first
5
+ First
6
+ end
7
+
8
+ def self.last
9
+ Last
10
+ end
11
+
12
+ def initialize(value)
13
+ @value = value
14
+ end
15
+
16
+ First = new(-1).freeze
17
+ Last = new(1).freeze
18
+
19
+ def <=>(other)
20
+ @value <=> if other
21
+ other.value
22
+ else
23
+ 0
24
+ end
25
+ end
26
+
27
+ module NilExtension
28
+ def <=>(other)
29
+ if ::Put === other
30
+ -(other <=> self)
31
+ else
32
+ super
33
+ end
34
+ end
35
+ end
36
+
37
+ ::NilClass.prepend(NilExtension)
38
+ end
data/put.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ require_relative "lib/put/version"
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "put"
5
+ spec.version = Put::VERSION
6
+ spec.authors = ["Justin Searls"]
7
+ spec.email = ["searls@gmail.com"]
8
+
9
+ spec.summary = "Put helps you write prioritized, multi-variate sort_by blocks"
10
+ spec.homepage = "https://github.com/testdouble/put"
11
+ spec.license = "MIT"
12
+ spec.required_ruby_version = ">= 2.6.0"
13
+
14
+ spec.metadata["homepage_uri"] = spec.homepage
15
+ spec.metadata["source_code_uri"] = spec.homepage
16
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(__dir__) do
21
+ `git ls-files -z`.split("\x0").reject do |f|
22
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
23
+ end
24
+ end
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+ end
data/sig/put.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Put
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,57 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: put
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Justin Searls
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-09-21 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - searls@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".standard.yml"
21
+ - CHANGELOG.md
22
+ - Gemfile
23
+ - Gemfile.lock
24
+ - LICENSE.txt
25
+ - README.md
26
+ - Rakefile
27
+ - lib/put.rb
28
+ - lib/put/version.rb
29
+ - put.gemspec
30
+ - sig/put.rbs
31
+ homepage: https://github.com/testdouble/put
32
+ licenses:
33
+ - MIT
34
+ metadata:
35
+ homepage_uri: https://github.com/testdouble/put
36
+ source_code_uri: https://github.com/testdouble/put
37
+ changelog_uri: https://github.com/testdouble/put/blob/main/CHANGELOG.md
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 2.6.0
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubygems_version: 3.3.20
54
+ signing_key:
55
+ specification_version: 4
56
+ summary: Put helps you write prioritized, multi-variate sort_by blocks
57
+ test_files: []