lino 2.2.0.pre.4 → 2.2.0.pre.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 027d718112a95bd94fcd6f88a2f387de6d60abc41a131112a226e9e21b14b0be
4
- data.tar.gz: ad1156f5456e249bf30ca814a3b6e55342ad62ff0c7b70ceb923e16992df56ce
3
+ metadata.gz: 729c96dd84a7a44337298eb3de557d061565d5f4defc5bd2077431e20f0917cc
4
+ data.tar.gz: 03c7697d78175ad6e2135540d2babeee039a9cdfd77cbcd789137db66561aa80
5
5
  SHA512:
6
- metadata.gz: 20e8f1c420a38574a3ab77b262cb7935afa64ec0db1ada92de14552adb5f845c330e2ddeb92a267c9037f682be0cc7ee170b78e40949a371011aeaa1644a194b
7
- data.tar.gz: 296b6b3b2f14aeb52a96e7c9458d1a84180764118ae94de38ab041d70ea7428088195a49d7b5f7e0daab1946d50cf8269d5faf4f24dcf50b1db79b2134efa1df
6
+ metadata.gz: 95af24c97c8d11bdbcdd44be3f78a72e0474fa8665f3bf3b67546caf34f6e93c7ba971b94df2efc8ae9a9b6f3e831a17c1dd04e07416fd54d48d9dd5ffed12e3
7
+ data.tar.gz: 151036608c99015ea9494e6ec17b21cb0055e6616d34669ca54009fe7b033b72de5323a240972763d512395ed3374a4d2134865f9ff89db535b5f5ca5bd9ae01
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lino (2.2.0.pre.4)
4
+ lino (2.2.0.pre.5)
5
5
  hamster (~> 3.0)
6
6
  open4 (~> 1.3)
7
7
 
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'utilities'
4
+
5
+ module Lino
6
+ module Appliables
7
+ include Lino::Utilities
8
+
9
+ def with_appliable(appliable)
10
+ return self if missing?(appliable)
11
+
12
+ appliable.apply(self)
13
+ end
14
+
15
+ def with_appliables(appliables)
16
+ return self if missing?(appliables)
17
+
18
+ appliables.inject(self) do |s, appliable|
19
+ s.with_appliable(appliable)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -5,6 +5,7 @@ require_relative 'utilities'
5
5
  require_relative 'command_line'
6
6
  require_relative 'subcommand_builder'
7
7
  require_relative 'options'
8
+ require_relative 'appliables'
8
9
 
9
10
  module Lino
10
11
  # rubocop:disable Metrics/ClassLength
@@ -20,6 +21,7 @@ module Lino
20
21
 
21
22
  include Lino::Utilities
22
23
  include Lino::Options
24
+ include Lino::Appliables
23
25
 
24
26
  class << self
25
27
  def for_command(command)
data/lib/lino/options.rb CHANGED
@@ -1,7 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'utilities'
4
+
3
5
  module Lino
4
6
  module Options
7
+ include Lino::Utilities
8
+
5
9
  def with_option(option, value, separator: nil, quoting: nil)
6
10
  return self if missing?(value)
7
11
 
@@ -3,11 +3,13 @@
3
3
  require 'hamster'
4
4
  require_relative 'utilities'
5
5
  require_relative 'options'
6
+ require_relative 'appliables'
6
7
 
7
8
  module Lino
8
9
  class SubcommandBuilder
9
10
  include Lino::Utilities
10
11
  include Lino::Options
12
+ include Lino::Appliables
11
13
 
12
14
  class <<self
13
15
  def for_subcommand(subcommand)
data/lib/lino/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lino
4
- VERSION = '2.2.0.pre.4'
4
+ VERSION = '2.2.0.pre.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lino
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0.pre.4
4
+ version: 2.2.0.pre.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson
@@ -222,6 +222,7 @@ files:
222
222
  - bin/console
223
223
  - bin/setup
224
224
  - lib/lino.rb
225
+ - lib/lino/appliables.rb
225
226
  - lib/lino/command_line.rb
226
227
  - lib/lino/command_line_builder.rb
227
228
  - lib/lino/options.rb