motion-paddle 1.2.0 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d64c5106e9c291b97d672fe970da18a8fcfbec2
4
- data.tar.gz: d38f55e551cbb2c849e51847c128f07ab0c7ca46
3
+ metadata.gz: e6bd08088403180daea4e29dd407aa701badd699
4
+ data.tar.gz: c80d46627b9d194570e7b2a1498ed65b2c3513d3
5
5
  SHA512:
6
- metadata.gz: 5743c663e41558ceb8548243a423b841ea9a386a3b1b121cb2f630b9e406f05b1714b1c1bd8c83d5b9239ca0856dc4899a0107e0f6ce0560e3c4c48c80b94a0c
7
- data.tar.gz: ef8171f480fd40e877cf382e64656d10fc94567a69b6c23abf48c345dcd2f2c9d115e0cac809ebdfc9bc3df4c9e6bcb1d0a63e58661cfe68bc4d79b47fe71e36
6
+ metadata.gz: 9c039939daf709e8fb6c688628631368289110581eea8afbcf7721e20126176a3a4b9535ad8e27856c81e02edeb357c6c1809ad17d824d0f4bd9575ecfe62fd1
7
+ data.tar.gz: abc6c768bd6a8f79e981710fb982e1e585ea50ff8ae6ea79da31371c67c5c481d137f540f3562683026938071b01b8f7b6aa1b5515b9f9c11aebe163a930090c
data/README.md CHANGED
@@ -101,7 +101,22 @@ Motion::Project::App.setup do |app|
101
101
  end
102
102
  set :vendor_id, 'vendor_id'
103
103
  set :api_key, 'api_key'
104
- set :store, ENV.fetch('store', 'paddle')
104
+
105
+ ...
106
+
107
+ end
108
+ end
109
+ ```
110
+
111
+ If you will **only** be doing the mac app store, you can avoid having to use the environment variable every time by changing your `Rakefile` to do something like this:
112
+
113
+ ```ruby
114
+ Motion::Project::App.setup do |app|
115
+ #...
116
+ app.paddle(force_mas: true) do
117
+ set :product_id, 'mas_product_id'
118
+ set :vendor_id, 'vendor_id'
119
+ set :api_key, 'api_key'
105
120
 
106
121
  ...
107
122
 
@@ -3,19 +3,21 @@ unless defined?(Motion::Project::Config)
3
3
  end
4
4
 
5
5
  class PaddleConfig
6
+ attr_reader :options
6
7
  attr_accessor :product_id, :vendor_id, :api_key, :current_price, :dev_name, :currency, :image,
7
8
  :product_name, :trial_duration, :trial_text, :product_image, :time_trial, :store
8
9
 
9
- def initialize(config)
10
+ def initialize(config, options)
10
11
  @config = config
12
+ @options = options
11
13
  end
12
14
 
13
15
  def mas_store?
14
- ENV.fetch('store', 'paddle').downcase == 'mas'
16
+ @options[:force_mas] || ENV.fetch('store', 'paddle').downcase == 'mas'
15
17
  end
16
18
 
17
19
  def paddle_store?
18
- ENV.fetch('store', 'paddle').downcase == 'paddle'
20
+ !@options[:force_mas] && ENV.fetch('store', 'paddle').downcase == 'paddle'
19
21
  end
20
22
 
21
23
  def set(var, val)
@@ -48,9 +50,15 @@ module Motion
48
50
  class Config
49
51
  variable :paddle
50
52
 
51
- def paddle(&block)
52
- @paddle ||= PaddleConfig.new(self)
53
+ def paddle(options = {}, &block)
54
+ @paddle ||= PaddleConfig.new(self, options)
53
55
  @paddle.instance_eval(&block) unless block.nil?
56
+ @paddle.set :store, @paddle.mas_store? ? 'mas' : 'paddle'
57
+ if @paddle.paddle_store?
58
+ @pods.pod 'Paddle', git: 'https://github.com/PaddleHQ/Mac-Framework.git'
59
+ elsif @paddle.mas_store?
60
+ @pods.pod 'Paddle-MAS', git: 'https://github.com/PaddleHQ/Paddle-MAS.git'
61
+ end
54
62
  @paddle
55
63
  end
56
64
  end
@@ -67,10 +75,5 @@ Motion::Project::App.setup do |app|
67
75
  app.files.push(File.join(File.dirname(__FILE__), 'paddle_setup.rb'))
68
76
 
69
77
  # include the correct framework for the store we're targeting
70
- if ENV.fetch('store', 'paddle').downcase == 'paddle'
71
- app.pods.pod 'Paddle', git: 'https://github.com/PaddleHQ/Mac-Framework.git'
72
- elsif ENV.fetch('store', 'paddle').downcase == 'mas'
73
- app.pods.pod 'Paddle-MAS', git: 'https://github.com/PaddleHQ/Paddle-MAS.git'
74
- end
75
78
 
76
79
  end
@@ -1,3 +1,3 @@
1
1
  module MotionPaddle
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-paddle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Henderson