Module: Radius::Toolbelt::ReleaseHelpers
- Defined in:
- lib/radius/toolbelt/release_helpers.rb
Instance Method Summary collapse
- #clean(dir) ⇒ Object
- #github_token ⇒ Object
- #release_github(repo, release_name, version, files) ⇒ Object
-
#release_repo(repo, version, files, dir = "build/release-repo") ⇒ Object
Clone down the ‘repo`, copy all the `file` over then commit, tag and push it up to the origin.
- #replace(src, dest) ⇒ Object
- #tag_version(ver) ⇒ Object
Instance Method Details
#clean(dir) ⇒ Object
21 22 23 24 |
# File 'lib/radius/toolbelt/release_helpers.rb', line 21 def clean(dir) rm_rf Dir.glob("#{dir}/*.framework") rm_rf Dir.glob("#{dir}/*.zip") end |
#github_token ⇒ Object
17 18 19 |
# File 'lib/radius/toolbelt/release_helpers.rb', line 17 def github_token @token ||= ENV["github_token"] || YAML.load(`cat ~/.config/hub`)["github.com"].first["oauth_token"] end |
#release_github(repo, release_name, version, files) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/radius/toolbelt/release_helpers.rb', line 26 def release_github(repo, release_name, version, files) tag_name = "v#{version}" body = "TODO: Describe the changes in this release" token = github_token r = ReleaseGithub.new repo, token, tag_name, release_name, body, files r.run end |
#release_repo(repo, version, files, dir = "build/release-repo") ⇒ Object
Clone down the ‘repo`, copy all the `file` over then commit, tag and push it up to the origin.
‘files` is an array of files to copy into the root of the local repo.
39 40 41 42 |
# File 'lib/radius/toolbelt/release_helpers.rb', line 39 def release_repo(repo, version, files, dir = "build/release-repo") r = ReleaseRepo.new repo, version, dir, files r.run end |
#replace(src, dest) ⇒ Object
13 14 15 |
# File 'lib/radius/toolbelt/release_helpers.rb', line 13 def replace(src, dest) FileUtils.copy_entry(src, dest, false, false, true) end |
#tag_version(ver) ⇒ Object
7 8 9 10 11 |
# File 'lib/radius/toolbelt/release_helpers.rb', line 7 def tag_version(ver) unless system("git tag v#{agvtool_version}") fail "Error: the tag v#{agvtool_version} already exists on this repo." end end |