firim 0.2.3 → 0.2.7

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: 04ba419f4d44e1deb98fd2a54f60bfd3b3423d1e0af267be37dc0ed6e777dff6
4
- data.tar.gz: 5c37017077f788a72d88503fc90e80a3c6c18c54c7c0d7efca032664ac3d84c5
3
+ metadata.gz: 339e2d1d86ea02e446677222594455558c3fa6876d9f823e69adb6928956fa72
4
+ data.tar.gz: 42e5e8010082ec75f884e22b2a1104b84de14b5c5ec2dacd6481df8e0cfd21d0
5
5
  SHA512:
6
- metadata.gz: 4c86ef0f93eed48e722c740b9100922e787d67aa56a6533d84226da61e1b3032db47af9139e4853b17d15adbdcc6a8eb104dc7933aada701026b81e0d707928c
7
- data.tar.gz: 8ce0799b7763a600f2a2d2fd14e0cff71930b28b3b70399ce63f995c30d3e6b061b5433462a1cbf671495a4915d4b699c85fbbc62d7d589036848c87a117ab29
6
+ metadata.gz: f0caec2a42a9f3fc5554d365dadb5ddd3630f760a37b3ab9aa7bed1b00bb7348a194d35c16104081d20f846326d8954a9a12b274880dbfaa9a994bdf6f160150
7
+ data.tar.gz: 9eab57e4111869ca0396fc7d64b843c90472698f4bb4504550fa0ec40eec61a940c6f54a52bd130e24a6c0a4953933d270535d82496ca4b367ab21304bb5a745
data/README.md CHANGED
@@ -1,3 +1,10 @@
1
+ ***Important***
2
+
3
+ ***For the reason of fir.im had changed the Base URL, pls set `firim_api_url` to `https://fir-api.fircli.cn/` or `https://api.bq04.com`.*** [issue](https://github.com/whlsxl/firim/issues/26)
4
+
5
+ From v0.2.5, the default `firim_api_url` set to `https://api.bq04.com`.
6
+
7
+ From firim v0.2.6, add show download url in terminal. [issue](https://github.com/whlsxl/firim/issues/32)
1
8
  # Firim
2
9
 
3
10
  Firim is a command tool to directly upload ipa and change app infomation on fir.im. fir.im is a Beta APP host website, you can upload ipa for AdHoc or InHouse distribution for testing.
@@ -22,7 +29,7 @@ Or install it yourself as:
22
29
 
23
30
  * `cd [your_project_folder]`
24
31
  * `firim init`
25
- * Enter your fir.im API Token (From [Fir.im](http://fir.im/apps))
32
+ * Enter your fir.im API Token (From [Fir.im](https://fir.im/apps))
26
33
  * `firim -i [your_ipa_path]`
27
34
 
28
35
  # Usage
@@ -37,9 +44,17 @@ Upload with icon ***NOTICE: Icon must be jpg format***
37
44
 
38
45
  firim -i [your_ipa_path] -l [your_icon_path]
39
46
 
40
- # Assgin API Token
47
+ Use `firim_api_url` to set API URL, if `fir.im` change the Base URL. default is `https://api.fir.im`.
48
+
49
+ After upload app to fir.im, firim will export some environment variables.
50
+
51
+ * `FIRIM_APP_SHORT` app's short path
52
+ * `FIRIM_APP_NAME` app's name
53
+ * `FIRIM_APP_URL` the download page of the app
54
+
55
+ # Assign API Token
41
56
 
42
- There are three ways to assgin Firim API Token
57
+ There are three ways to assign Firim API Token
43
58
 
44
59
  1. Set `FIRIM_TOKEN` environment variables
45
60
  2. Add `token` to `macOS Keychain`
@@ -64,7 +79,6 @@ The gem is available as open source under the terms of the [MIT License](http://
64
79
 
65
80
  # TODO
66
81
 
67
- * Export all app infomation to a file
68
- * Generate a web page show all the app's link and infomations
69
- * Show the app list, and export all app infomations to a file
70
- * force reset icon
82
+ - [ ] Generate a web page show all the app's link and infomations
83
+ - [x] Show the app list, and export all app infomations to a file
84
+ - [ ] force reset icon
data/lib/firim/options.rb CHANGED
@@ -9,6 +9,10 @@ module Firim
9
9
  FastlaneCore::ConfigItem.new(key: :platform,
10
10
  optional: true,
11
11
  description: "The fir platform, support ios/android"),
12
+ # fir.im api url
13
+ FastlaneCore::ConfigItem.new(key: :firim_api_url,
14
+ default_value: "https://api.bq04.com",
15
+ description: "fir.im api URL"),
12
16
  # firim info
13
17
  FastlaneCore::ConfigItem.new(key: :firim_api_token,
14
18
  short_option: "-a",
@@ -17,6 +21,12 @@ module Firim
17
21
  FastlaneCore::ConfigItem.new(key: :firim_username,
18
22
  optional: true,
19
23
  description: "fir.im username, a sign for identify different token"),
24
+
25
+ FastlaneCore::ConfigItem.new(key: :download_page_prefix,
26
+ short_option: "-p",
27
+ optional: true,
28
+ default_value: "http://d.firim.top/",
29
+ description: "fir.im user api token"),
20
30
  # Content path
21
31
  FastlaneCore::ConfigItem.new(key: :ipa,
22
32
  optional: true,
data/lib/firim/runner.rb CHANGED
@@ -7,8 +7,9 @@ module Firim
7
7
  attr_accessor :options
8
8
  attr_reader :firim_client
9
9
 
10
- def self.firim_hostname
11
- return "http://api.fir.im/"
10
+ def firim_hostname
11
+ api_url = self.options[:firim_api_url]
12
+ return api_url
12
13
  end
13
14
 
14
15
  def guess_platform
@@ -41,7 +42,7 @@ module Firim
41
42
  self.options[:platform] = self.guess_platform
42
43
  UI.user_error!("Platform not given --platform ios/android") if self.options[:platform] == nil
43
44
 
44
- @firim_client = Faraday.new(self.class.firim_hostname, conn_options) do |c|
45
+ @firim_client = Faraday.new(self.firim_hostname, conn_options) do |c|
45
46
  c.request :url_encoded # form-encode POST params
46
47
  c.adapter :net_http
47
48
  c.response :json, :content_type => /\bjson$/
@@ -62,6 +63,10 @@ module Firim
62
63
  @app_info.merge!( update_app_info(@app_info["id"]))
63
64
  write_app_info_to_file
64
65
  options = @app_info
66
+ options[:download_page_url] = download_url
67
+ ENV["FIRIM_APP_URL"] = download_url
68
+ ENV["FIRIM_APP_NAME"] = options["name"]
69
+ ENV["FIRIM_APP_SHORT"] = options["short"]
65
70
  FastlaneCore::PrintTable.print_values(config: options, title: "#{@app_info["name"]}'s' App Info")
66
71
  end
67
72
 
@@ -69,11 +74,20 @@ module Firim
69
74
  file_path = self.options[:app_info_to_file_path]
70
75
  return if file_path == nil
71
76
  File.open(file_path, "at") do |f|
72
- f.write("#{@app_info["name"]}: http://fir.im/#{@app_info["short"]} \n")
77
+ d_url = download_url
78
+ f.write("#{@app_info["name"]}: #{d_url}\n")
73
79
  UI.success "Write app info to #{file_path} successed!"
74
80
  end
75
81
  end
76
82
 
83
+ def download_url
84
+ prefix = self.options[:download_page_prefix]
85
+ if prefix[1..-1] != "/"
86
+ return "#{prefix}/#{@app_info["short"]}"
87
+ end
88
+ return "#{prefix}#{@app_info["short"]}"
89
+ end
90
+
77
91
  def validation_response response_data
78
92
  error_code = response_data['code'].to_i
79
93
  return if error_code == 0
data/lib/firim/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Firim
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - whlsxl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-04 00:00:00.000000000 Z
11
+ date: 2021-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane
@@ -30,34 +30,6 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 3.0.0
33
- - !ruby/object:Gem::Dependency
34
- name: faraday
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '0.9'
40
- type: :runtime
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '0.9'
47
- - !ruby/object:Gem::Dependency
48
- name: faraday_middleware
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '0.9'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '0.9'
61
33
  - !ruby/object:Gem::Dependency
62
34
  name: bundler
63
35
  requirement: !ruby/object:Gem::Requirement