nockr 0.0.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 +7 -0
- data/lib/nockr/noun.rb +22 -0
- data/lib/nockr.rb +10 -0
- data/nockr.gemspec +16 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 83137b93c6aa129d9a8527caf972285b7cafb0bee1bbdec4d776505699755b0a
|
4
|
+
data.tar.gz: 7b9274283fb21981e20ea8ba0076bf79d48c0236182fda9b1afa0cd3985bb89b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f9b4c2fb5225a87bd2b32eb208582bc7405e83ea81df0d69327bb28e62c4a373e52b52ac3210aa87ff459e671fe0e268430e205da8bebdfb7b2176ee175d4b35
|
7
|
+
data.tar.gz: b09d2c70955288118fc879afad504fe34e3efe659b666502e08ae0230e71fb51bee93212d96f1efb05504c9985e26bcbe841edf26ece220d44045a1d1a76e07e
|
data/lib/nockr/noun.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
module NockR
|
2
|
+
class Noun
|
3
|
+
def initialize(input_ary:)
|
4
|
+
raise ArgumentError.new("a Noun must be initialized with an Array") unless input_ary.is_a? Array
|
5
|
+
@i = input_ary
|
6
|
+
end
|
7
|
+
|
8
|
+
def interpret
|
9
|
+
@n = self.to_tuples @i
|
10
|
+
return "Interpreting #{@n} as Nock."
|
11
|
+
end
|
12
|
+
|
13
|
+
#
|
14
|
+
# q.v. https://github.com/belisarius222/pynock
|
15
|
+
#
|
16
|
+
def to_tuples(ary)
|
17
|
+
return ary unless ary.is_a? Array
|
18
|
+
return [self.to_tuples(ary[0]), self.to_tuples(ary[1])] if 2 == ary.size
|
19
|
+
return [ary[0], self.to_tuples(ary[1..])]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/nockr.rb
ADDED
data/nockr.gemspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "nockr"
|
3
|
+
s.summary = "NockR"
|
4
|
+
s.description = "A Nock interpreter in Ruby"
|
5
|
+
s.authors = ["Daryl Richter"]
|
6
|
+
s.email = "winter8@duck.com"
|
7
|
+
|
8
|
+
s.files = Dir.glob("lib{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
|
9
|
+
s.files += %w[nockr.gemspec] # include the gemspec itself because warbler breaks w/o it
|
10
|
+
|
11
|
+
s.homepage = "https://rubygems.org/gems/nockr"
|
12
|
+
s.license = "BSD-3-Clause"
|
13
|
+
s.require_paths = ["lib"]
|
14
|
+
s.required_ruby_version = Gem::Requirement.new(">= 3.2.2")
|
15
|
+
s.version = "0.0.1"
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nockr
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daryl Richter
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-06-27 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A Nock interpreter in Ruby
|
14
|
+
email: winter8@duck.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/nockr.rb
|
20
|
+
- lib/nockr/noun.rb
|
21
|
+
- nockr.gemspec
|
22
|
+
homepage: https://rubygems.org/gems/nockr
|
23
|
+
licenses:
|
24
|
+
- BSD-3-Clause
|
25
|
+
metadata: {}
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 3.2.2
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubygems_version: 3.4.14
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: NockR
|
45
|
+
test_files: []
|