Skip to content

Commit

Permalink
Merge pull request #1 from jasonnam/develop
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
jasonnam authored May 4, 2019
2 parents 0fc7fc3 + e1063bc commit 4e4802e
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 54 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
language: ruby
deploy:
provider: rubygems
gem: fastlane-plugin-copy
api_key: $RUBYGEMS_API_KEY
gem: fastlane-plugin-file_manager
api_key: "$RUBYGEMS_API_KEY"
on:
branch: master
env:
global:
secure: qH91MR+kiPtyWcPnbr3ikc4gbFJrnTH/dYbBG/Lj6xyiGwsW3TlGToYBOCjyuaCOJ+wtbL8r+T6t7XXp4EMqtPweRxnp0flNF+l1OKiWRJ9oiZ9G6UrJ6S2xnBfyMhLHpSQAmOHUcZjwjuy9Wb0rTryUoAPi+Wa73nYUSigNyBSOCTcPGw55fYEyOPDUe6aAyNCoxoytX5rhW3bbNxd6rwFdfGyf8AzAA0d++nsaxHO+qBP0JHELTZh7CRDGvueQ8APw/UtMLsTLwcHnMBeJPtcxF1Ln9+3V8tXL1C7wjxsjimRbMGK77HBGbD178frWMMXrLN/bTdFiXRAqjvAq95wPe6bQXJx39TRGAY9C1V/KXjAjH0MHq3YzRRB0xZ0N03s5GiI2YI5f4umdWlrCPfuqcKzdkiPdzuTtoCXvF3rt8OMcCyVwfQqBIJsH6PzAP3rzmf0CLJYmQxKvRXVraL2IKFKPi2RfVUJbaq2szOzQ6lQIum1h5RIy7LZLLk364tlzQsyV579jQgwteOBeaBTmm2r8wi0fizgrgFSfEPWL4wzwu89pCn88SOC7rlwCnCy7mftWT0Z3gOCP+zuF/QXoAI8BII+8wVVCy+EUDQ+Z40+J73CZa844kW1Ck7WqHUa2N2FQcScHDKpjaJklx1b5MmdZS5wovKNoO12YB0s=
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.1.0 - 2019-05-02
## [0.2.0] - 2019-05-04
### Added
- copy action
- `remove_files` action

### Changed
- Rename gem to `fastlane-plugin-file_manager`
- Rename from `copy` to `copy_files`

## [0.1.0] - 2019-05-02
### Added
- `copy` action

[0.2.0]: https://github.com/jasonnam/fastlane-plugin-file_manager/compare/0.1.0...0.2.0
[0.1.0]: https://github.com/jasonnam/fastlane-plugin-file_manager/releases/tag/0.1.0
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
# fastlane-plugin-copy
# fastlane-plugin-file_manager

[![fastlane plugin badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-copy)
[![gem version](https://img.shields.io/gem/v/fastlane-plugin-copy.svg)](https://rubygems.org/gems/fastlane-plugin-copy)
[![travis-ci build status](https://travis-ci.com/jasonnam/fastlane-plugin-copy.svg?branch=master)](https://travis-ci.com/jasonnam/fastlane-plugin-copy)
[![fastlane plugin badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-file_manager)
[![gem version](https://img.shields.io/gem/v/fastlane-plugin-file_manager.svg)](https://rubygems.org/gems/fastlane-plugin-file_manager)
[![travis-ci build status](https://travis-ci.com/jasonnam/fastlane-plugin-file_manager.svg?branch=master)](https://travis-ci.com/jasonnam/fastlane-plugin-file_manager)

## Getting Started

This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-copy`, add it to your project by running:
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-file_manager`, add it to your project by running:

```bash
fastlane add_plugin copy
fastlane add_plugin file_manager
```

## About fastlane-plugin-copy
## About fastlane-plugin-file_manager

Copy file.
Copy and remove files.

## Example

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`.

```ruby
lane :test do
copy(
source: "test.rb",
destination: "lib"
)
copy_files(source: "test.rb", destination: "lib")
remove_files(path: "test.rb")
end
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,22 @@

lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "fastlane/plugin/copy/version"
require "fastlane/plugin/file_manager/version"

Gem::Specification.new do |spec|
spec.name = "fastlane-plugin-copy"
spec.version = Fastlane::Copy::VERSION
spec.name = "fastlane-plugin-file_manager"
spec.version = Fastlane::FileManager::VERSION
spec.author = "Jason Nam"
spec.email = "[email protected]"

spec.summary = "Copy file"
spec.homepage = "https://github.com/jasonnam/fastlane-plugin-copy"
spec.summary = "Copy and remove files"
spec.homepage = "https://github.com/jasonnam/fastlane-plugin-file_manager"
spec.license = "MIT"

spec.files = Dir["lib/**/*"] + %w(README.md LICENSE)
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

# Don"t add a dependency to fastlane or fastlane_re
# since this would cause a circular dependency

# spec.add_dependency "your-dependency", "~> 1.0.0"

spec.add_development_dependency("pry")
spec.add_development_dependency("bundler")
spec.add_development_dependency("rspec")
Expand Down
6 changes: 2 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
lane :test do
copy(
source: "test.rb",
destination: "lib"
)
copy_files(source: "test.rb", destination: "lib")
remove_files(path: "test.rb")
end
9 changes: 0 additions & 9 deletions lib/fastlane/plugin/copy/helper/copy_helper.rb

This file was deleted.

5 changes: 0 additions & 5 deletions lib/fastlane/plugin/copy/version.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "fastlane/plugin/copy/version"
require "fastlane/plugin/file_manager/version"

module Fastlane
module Copy
module FileManager
# Return all .rb files inside the "actions" and "helper" directory
def self.all_classes
Dir[File.expand_path("**/{actions,helper}/*.rb", File.dirname(__FILE__))]
Expand All @@ -11,6 +11,6 @@ def self.all_classes

# By default we want to import all available actions and helpers
# A plugin can contain any number of actions and plugins
Fastlane::Copy.all_classes.each do |current|
Fastlane::FileManager.all_classes.each do |current|
require current
end
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
require "fastlane/action"
require_relative "../helper/copy_helper"

module Fastlane
module Actions
class CopyAction < Action
class CopyFilesAction < Action
def self.run(params)
Helper::CopyHelper.copy(params[:source], params[:destination])
Actions.sh("cp", params[:source], params[:destination])
end

def self.description
"Copy file"
"Copy files"
end

def self.authors
Expand Down
33 changes: 33 additions & 0 deletions lib/fastlane/plugin/file_manager/actions/remove_files_action.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require "fastlane/action"

module Fastlane
module Actions
class RemoveFilesAction < Action
def self.run(params)
Actions.sh("rm", "-rf", params[:path])
end

def self.description
"Remove files"
end

def self.authors
["Jason Nam"]
end

def self.available_options
[
FastlaneCore::ConfigItem.new(key: :path,
short_option: "-p",
description: "Path for files to remove",
optional: false,
type: String)
]
end

def self.is_supported?(platform)
true
end
end
end
end
5 changes: 5 additions & 0 deletions lib/fastlane/plugin/file_manager/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Fastlane
module FileManager
VERSION = "0.2.0"
end
end
4 changes: 2 additions & 2 deletions spec/copy_action_spec.rb → spec/copy_files_action_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
describe Fastlane::Actions::CopyAction do
describe Fastlane::Actions::CopyFilesAction do
describe "#run" do
it "executes cp command with source and destination" do
expect(Fastlane::Actions).to receive(:sh).with("cp", "test.rb", "lib")

Fastlane::Actions::CopyAction.run(source: "test.rb", destination: "lib")
Fastlane::Actions::CopyFilesAction.run(source: "test.rb", destination: "lib")
end
end
end
9 changes: 9 additions & 0 deletions spec/remove_files_action_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe Fastlane::Actions::RemoveFilesAction do
describe "#run" do
it "executes rm command with path" do
expect(Fastlane::Actions).to receive(:sh).with("rm", "-rf", "test.rb")

Fastlane::Actions::RemoveFilesAction.run(path: "test.rb")
end
end
end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ module SpecHelper
end

require "fastlane" # to import the Action super class
require "fastlane/plugin/copy" # import the actual plugin
require "fastlane/plugin/file_manager" # import the actual plugin

Fastlane.load_actions # load other actions (in case your plugin calls other actions or shared values)

0 comments on commit 4e4802e

Please sign in to comment.