fastlane-plugin-upload_to_onesky 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2ec04763d2ec6a9b9a9db0d474e0734753c83e0c
4
+ data.tar.gz: d12faf607c5fedfb103356c8bb3419d660001201
5
+ SHA512:
6
+ metadata.gz: 7c66ff45f2a6a3fcf43f97c647baa3931d31e82c7b9926fa394ad5959f57644b31d3bc4c7ef2b4996cdf3b48e425ffe377410f2e8a633afa94ef181a88c3d1fd
7
+ data.tar.gz: 4ecefd6eddf96292406ceb015984d109d6283af036052b61e7a28232184eb5458ad601e9e8622ff9755b5458aa940d0c7dba5c3884e9406941e74ea8237d651a
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 joshrlesch <josh.r.lesch@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # upload_to_onesky plugin
2
+
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-upload_to_onesky)
4
+
5
+ ## Getting Started
6
+
7
+ This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-upload_to_onesky`, add it to your project by running:
8
+
9
+ ```bash
10
+ fastlane add_plugin upload_to_onesky
11
+ ```
12
+
13
+ ## About upload_to_onesky
14
+
15
+ Upload a strings file to OneSky
16
+
17
+ **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
18
+
19
+ ## Example
20
+
21
+ Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
22
+
23
+ **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
24
+
25
+ ## Run tests for this plugin
26
+
27
+ To run both the tests, and code style validation, run
28
+
29
+ ```
30
+ rake
31
+ ```
32
+
33
+ To automatically fix many of the styling issues, use
34
+ ```
35
+ rubocop -a
36
+ ```
37
+
38
+ ## Issues and Feedback
39
+
40
+ For any other issues and feedback about this plugin, please submit it to this repository.
41
+
42
+ ## Troubleshooting
43
+
44
+ If you have trouble using plugins, check out the [Plugins Troubleshooting](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md) doc in the main `fastlane` repo.
45
+
46
+ ## Using `fastlane` Plugins
47
+
48
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Plugins.md).
49
+
50
+ ## About `fastlane`
51
+
52
+ `fastlane` is the easiest way to automate building and releasing your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
@@ -0,0 +1,84 @@
1
+ module Fastlane
2
+ module Actions
3
+ class UploadToOneskyAction < Action
4
+ def self.run(params)
5
+ Actions.verify_gem!('onesky-ruby')
6
+ require 'onesky'
7
+
8
+ client = Onesky::Client.new(params[:public_key], params[:secret_key])
9
+
10
+ project = client.project(params[:project_id])
11
+
12
+ UI.success 'Starting the upload to OneSky'
13
+ resp = project.upload_file(file: params[:strings_file_path], file_format: params[:strings_file_format])
14
+
15
+ if resp.code == 201
16
+ UI.success "#{File.basename params[:strings_file_path]} was successfully uploaded to project #{params[:project_id]} in OneSky"
17
+ else
18
+ UI.error "Error uploading file to OneSky, Status code is #{resp.code}"
19
+ end
20
+
21
+ end
22
+
23
+ def self.description
24
+ 'Upload a strings file to OneSky'
25
+ end
26
+
27
+ def self.authors
28
+ ['JMoravec', 'joshrlesch']
29
+ end
30
+
31
+ def self.available_options
32
+ [
33
+ FastlaneCore::ConfigItem.new(key: :public_key,
34
+ env_name: 'ONESKY_PUBLIC_KEY',
35
+ description: 'Public key for OneSky',
36
+ is_string: true,
37
+ optional: false,
38
+ verify_block: proc do |value|
39
+ raise "No Public Key for OneSky given, pass using `public_key: 'token'`".red unless (value and not value.empty?)
40
+ end),
41
+ FastlaneCore::ConfigItem.new(key: :secret_key,
42
+ env_name: 'ONESKY_SECRET_KEY',
43
+ description: 'Secret Key for OneSky',
44
+ is_string: true,
45
+ optional: false,
46
+ verify_block: proc do |value|
47
+ raise "No Secret Key for OneSky given, pass using `secret_key: 'token'`".red unless (value and not value.empty?)
48
+ end),
49
+ FastlaneCore::ConfigItem.new(key: :project_id,
50
+ env_name: 'ONESKY_PROJECT_ID',
51
+ description: 'Project Id to upload file to',
52
+ optional: false,
53
+ verify_block: proc do |value|
54
+ raise 'No project id given'.red unless (value and not value.empty?)
55
+ end),
56
+ FastlaneCore::ConfigItem.new(key: :strings_file_path,
57
+ env_name: 'ONESKY_STRINGS_FILE_PATH',
58
+ description: 'Base file path for the strings file to upload',
59
+ is_string: true,
60
+ optional: false,
61
+ verify_block: proc do |value|
62
+ raise "Couldn't find file at path '#{value}'".red unless File.exist?(value)
63
+ end),
64
+ FastlaneCore::ConfigItem.new(key: :strings_file_format,
65
+ env_name: 'ONESKY_STRINGS_FORMAT',
66
+ description: 'Format of the strings file: see https://github.com/onesky/api-documentation-platform/blob/master/reference/format.md',
67
+ is_string: true,
68
+ optional: false,
69
+ verify_block: proc do |value|
70
+ raise 'No file format given'.red unless (value and not value.empty?)
71
+ end)
72
+ ]
73
+ end
74
+
75
+ def self.is_supported?(platform)
76
+ # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
77
+ # See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
78
+ #
79
+ # [:ios, :mac, :android].include?(platform)
80
+ true
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,12 @@
1
+ module Fastlane
2
+ module Helper
3
+ class UploadToOneskyHelper
4
+ # class methods that you define here become available in your action
5
+ # as `Helper::UploadToOneskyHelper.your_method`
6
+ #
7
+ def self.show_message
8
+ UI.message("Hello from the upload_to_onesky plugin helper!")
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module UploadToOnesky
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/upload_to_onesky/version'
2
+
3
+ module Fastlane
4
+ module UploadToOnesky
5
+ # Return all .rb files inside the "actions" and "helper" directory
6
+ def self.all_classes
7
+ Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
8
+ end
9
+ end
10
+ end
11
+
12
+ # By default we want to import all available actions and helpers
13
+ # A plugin can contain any number of actions and plugins
14
+ Fastlane::UploadToOnesky.all_classes.each do |current|
15
+ require current
16
+ end
metadata ADDED
@@ -0,0 +1,153 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-upload_to_onesky
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - joshrlesch
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-07-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: onesky-ruby
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.1
33
+ - !ruby/object:Gem::Dependency
34
+ name: pry
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rspec
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rake
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rubocop
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: fastlane
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 1.99.0
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 1.99.0
117
+ description:
118
+ email: josh.r.lesch@gmail.com
119
+ executables: []
120
+ extensions: []
121
+ extra_rdoc_files: []
122
+ files:
123
+ - LICENSE
124
+ - README.md
125
+ - lib/fastlane/plugin/upload_to_onesky.rb
126
+ - lib/fastlane/plugin/upload_to_onesky/actions/upload_to_onesky_action.rb
127
+ - lib/fastlane/plugin/upload_to_onesky/helper/upload_to_onesky_helper.rb
128
+ - lib/fastlane/plugin/upload_to_onesky/version.rb
129
+ homepage:
130
+ licenses:
131
+ - MIT
132
+ metadata: {}
133
+ post_install_message:
134
+ rdoc_options: []
135
+ require_paths:
136
+ - lib
137
+ required_ruby_version: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ required_rubygems_version: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ requirements: []
148
+ rubyforge_project:
149
+ rubygems_version: 2.5.1
150
+ signing_key:
151
+ specification_version: 4
152
+ summary: Upload a strings file to OneSky
153
+ test_files: []