Class: Bundler::Thankyou::CLI
- Inherits:
-
Thor
- Object
- Thor
- Bundler::Thankyou::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/bundler/thankyou/cli.rb
Constant Summary collapse
- MINIMUM_AMOUNT =
minimum amount in sats for each recipient
100
- CONFIG_FILE =
File.join(ENV['HOME'], '.bundle-thankyou.yml')
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#recipients ⇒ Object
Returns the value of attribute recipients.
Instance Method Summary collapse
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
13 14 15 |
# File 'lib/bundler/thankyou/cli.rb', line 13 def amount @amount end |
#recipients ⇒ Object
Returns the value of attribute recipients.
13 14 15 |
# File 'lib/bundler/thankyou/cli.rb', line 13 def recipients @recipients end |
Instance Method Details
#fund(*names) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/bundler/thankyou/cli.rb', line 33 def fund(*names) if names.empty? invoke :gemfile else self.recipients = Bundler::Thankyou.recipients_from_rubygems(names) disburse! end end |
#gemfile ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/bundler/thankyou/cli.rb', line 21 def gemfile say "Analyzing Gemfile: #{Bundler.default_gemfile}" say '...' self.recipients = Bundler::Thankyou.recipients_from_bundler() disburse! end |
#setup ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/bundler/thankyou/cli.rb', line 43 def setup say 'Connecting your LND node' config = {} config['address'] = ask('Address of your LND node (e.g. localhost:10009):') config['macaroon_path'] = ask('Macaroon file path: (e.g. /path/to/admin.macaroon):', path: true) config['credentials_path'] = ask('Credentials file path: (e.g. /path/to/tls.cert):', path: true) add_file(CONFIG_FILE, YAML.dump(config)) node_info = lnd_client.lightning.get_info say "Successfully connected to #{node_info['alias']} #{node_info['identity_pubkey']}" end |