docman 0.0.57 → 0.0.58

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: e17cc53f17b11541845641a2484a3f6511065c50
4
- data.tar.gz: 6f6b8bba4b65b3d41473eb7f9f6b03b81bfb0d55
3
+ metadata.gz: 2bdd883823f0e69f4f90e51057458cf324078dc4
4
+ data.tar.gz: 137c6f73fc77ce5a44a617361593202002664e0a
5
5
  SHA512:
6
- metadata.gz: 3a04a93690ef52e90d3a763d11bfef783e3b56f26c147516da5f1680c309ce6004d5a5dd5fa606f12f977c8f28311b4092577f5c757764e6d1f869aaf60fe291
7
- data.tar.gz: da1ea048d609e0a0176c36cc5ba80c74944b8e9137ca87d59619678fc0f8323e7aaf6f367dd47902d9fb0d8e01d494542148706bafa5791bc0ce6c62b62f88ad
6
+ metadata.gz: 92c3c175673d9b25e7d04b3a927b3ab204d82febd6cf07f6d5983e51de0a2561ee76ed65085336aa025ae7463fddda2cef9897a445a2593f142e0688e7788a84
7
+ data.tar.gz: 1a238ca622220d257bd8b8bb8ac39895b03854e403cca265b5f049ba076f99bb9d2cae6bfd4e7735aa9623cabd63498816f2dc38a62648f1b0317a408547a39f
@@ -0,0 +1,15 @@
1
+ #!/bin/bash
2
+
3
+ if [ -n "$1" ]; then
4
+ git fetch
5
+ BRANCH="$1"
6
+ git ls-remote --exit-code . origin/${BRANCH} &> /dev/null
7
+ if [ $? == 0 ]; then
8
+ git checkout ${BRANCH}
9
+ git pull origin ${BRANCH}
10
+ else
11
+ git checkout --orphan ${BRANCH}
12
+ git rm --cached -r .
13
+ git clean -f -d
14
+ fi
15
+ fi
@@ -111,6 +111,22 @@ module Docman
111
111
  end
112
112
  end
113
113
 
114
+ def drush(env, site, command)
115
+ with_rescue(false) do
116
+ cmd = "drush env: '#{env}', site: '#{site}', '#{command}'"
117
+ log cmd
118
+ path = Dir.pwd
119
+ branch = 'commands'
120
+ currentBranch = GitUtil.branch
121
+ Exec.do "#{Application::bin}/check-branch.sh #{branch}"
122
+ File.open(File.join(path, 'commands'), 'w') {|f| f.write cmd}
123
+ GitUtil.exec("add commands")
124
+ GitUtil.exec("commit -m 'Added command'")
125
+ GitUtil.push(path, branch)
126
+ GitUtil.exec("checkout #{currentBranch}")
127
+ end
128
+ end
129
+
114
130
  def write_state state
115
131
  filepath = File.join(@workspace_dir, 'state')
116
132
  File.open(filepath, 'w') { |file| file.write(state) }
@@ -86,6 +86,14 @@ module Docman
86
86
  say('Complete!', :green)
87
87
  end
88
88
 
89
+ desc 'drush', 'Execute remote drush commands'
90
+ def drush(drush_alias, command)
91
+ env = drush_alias.partition('.').first.partition('@').last
92
+ site = drush_alias.partition('.').last
93
+ Application.instance.drush(env, site, command)
94
+ say('Complete!', :green)
95
+ end
96
+
89
97
  no_commands {
90
98
  def current_dir_has_config_dir
91
99
  File.directory?('config')
@@ -82,9 +82,13 @@ module Docman
82
82
  end
83
83
  end
84
84
 
85
- def self.pull(path)
85
+ def self.pull(path, options = nil)
86
86
  Dir.chdir path
87
- exec 'pull'
87
+ exec "pull#{options}"
88
+ end
89
+
90
+ def self.branch()
91
+ exec "rev-parse --abbrev-ref HEAD", false
88
92
  end
89
93
 
90
94
  def self.repo?(path)
@@ -101,10 +105,10 @@ module Docman
101
105
  result.delete!("\n")
102
106
  end
103
107
 
104
- def self.push(root_path, version)
108
+ def self.push(root_path, version, show_result = true)
105
109
  Dir.chdir root_path
106
- exec "pull origin #{version}"
107
- exec "push origin #{version}"
110
+ exec "pull origin #{version}", show_result
111
+ exec "push origin #{version}", show_result
108
112
  end
109
113
 
110
114
  def self.tag(root_path, tag)
@@ -1,3 +1,3 @@
1
1
  module Docman
2
- VERSION = "0.0.57"
2
+ VERSION = "0.0.58"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.57
4
+ version: 0.0.58
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Tolstikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-07 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -141,6 +141,7 @@ email:
141
141
  - atolstikov@adyax.com
142
142
  executables:
143
143
  - bump-version.sh
144
+ - check-branch.sh
144
145
  - dm_repo_clean.sh
145
146
  - docman
146
147
  - docman.rb
@@ -155,6 +156,7 @@ files:
155
156
  - README.md
156
157
  - Rakefile
157
158
  - bin/bump-version.sh
159
+ - bin/check-branch.sh
158
160
  - bin/dm_repo_clean.sh
159
161
  - bin/docman
160
162
  - bin/docman.rb