itch_rewards 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 532a40f260d7f2942244c1b983c20eea419c18eeea3ac601cb41f461e11eefd5
4
- data.tar.gz: 5609c23072f7f006ca5a781f1c561d613942fcf1d8856c48f0c9f294d2d46e18
3
+ metadata.gz: b692518ae6391102d89d5b4fe6f13a378553eba7db5686cfeab7071f7ea5c614
4
+ data.tar.gz: 9b3b5e7dd6bf52733ec24bffcf2590bf1368ab0f2a0737e3656cbe54b493b228
5
5
  SHA512:
6
- metadata.gz: 63e1a8858b7250c27a782ba1e57bdd1af9833070c88d5e720fb371d1ef5689f4211f4cafbc62c4964e656bd88f12d497049f5e1fc7f24ac049e89d329e201d28
7
- data.tar.gz: b151326787353dabd45dfef0180c088edeac0180df15703b74fb297b8b2032d2950f542c0bec49632cf51874401fa0fdc293d26c32ab59bdf83a77aa18ee9d13
6
+ metadata.gz: d0cada09e0bdac62f5fe23e9c98daa7e90b9a2d79940667e1425ca507b945fda71dd8d0e3df30bdddaf0158362b155038b89d860df03b16b2855ee4cda734158
7
+ data.tar.gz: e8f02d9624f426c0d78c9f575657b25ad87d766ddf02033233f9920ff570ad735ea90dd148ef05a5e3e6c173f595fba92a0db967e94e64e84ba27b7848e170c0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- itch_rewards (0.1.2)
4
+ itch_rewards (0.1.3)
5
5
  dry-cli (~> 0.7.0)
6
6
  itch_client (~> 0.2.0)
7
7
  pastel (~> 0.8.0)
@@ -97,6 +97,16 @@ module ItchRewards
97
97
  include AuthOptions
98
98
  @options = @options.reject {|opt| [:cookies, :interactive].include? opt.name }
99
99
 
100
+ def write_config(path, options)
101
+ require 'erb'
102
+ client = authenticated_client!(options)
103
+
104
+ games = client.game_map.map.values
105
+ template = File.read(File.join(__dir__, 'templates/reward_config.yml.erb'))
106
+
107
+ File.write(path, ERB.new(template, trim_mode: '-').result(binding))
108
+ end
109
+
100
110
  desc "Save cookies for itch.io and create reward config example file"
101
111
  def call(**options)
102
112
  options[:cookies] ||= cli.ask("Where would you like to store your login cookies? ", default: ".itch-cookies.yml")
@@ -114,7 +124,7 @@ module ItchRewards
114
124
  result = cli.yes?("Config file #{config_path} does not exist, would you like to create it?")
115
125
 
116
126
  if result
117
- Rewards.write_config(config_path, options)
127
+ write_config(config_path, options)
118
128
  cli.say "Config file written to #{config_path}"
119
129
  end
120
130
  else
@@ -148,16 +158,6 @@ module ItchRewards
148
158
  cli.say render_table(table)
149
159
  end
150
160
 
151
- def self.write_config(path, options)
152
- require 'erb'
153
- client = authenticated_client!(options)
154
-
155
- games = client.game_map.map.values
156
- template = File.read(File.join(__dir__, 'templates/reward_config.yml.erb'))
157
-
158
- File.write(options[:config], ERB.new(template, trim_mode: '-').result(binding))
159
- end
160
-
161
161
  def self.load_config(path)
162
162
  YAML.load_file(path)
163
163
  rescue YAML::ParseError => e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ItchRewards
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itch_rewards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Billiam