MrMurano 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2c35398ec8949a3fc15cb9bb21f6bdb1940a7a0
4
- data.tar.gz: 5364d2f10f5bcf8962c702da5790fcdf28cf4d17
3
+ metadata.gz: 37c49c0b975dd14d40e55d57a2c806931d442423
4
+ data.tar.gz: 98a232cf51e5155d5943ff02f5d2b32a62a76cb3
5
5
  SHA512:
6
- metadata.gz: a1bf859c01ebb93ceb5bd9b3723b5495c5fefeacb89deef59614ee8f95c4ebe168a6c3b6bc2aac3845de33cdd1cbcfa9ec7d0b1f9a2837e931e571484e88e4a6
7
- data.tar.gz: f8c22edda2251ae52e43a134042989868f14b7f16834d825d559c67062645e2de6dc9af5021f7e4fe84b7c3512426f69145c9790207e77ba6308e5677881eda9
6
+ metadata.gz: e40e5b6b729e25dec8ec4f07785805b2185ee9106dfe7bfc07e31ba75703ca14d56272056f6815aa7f3accaa3809fd200f5541b3fa8c9d2a576566c498d19e29
7
+ data.tar.gz: 1e067ca68bbc3948af5540d8c89afc1a2f3508b3466ee253dab8ec989cd8834fc80e2d91fe33b1a38f7aeed4b4b89cb3c609a58ab3b7dd0cb83b8ab92057ce2e
data/README.markdown CHANGED
@@ -11,11 +11,12 @@ To start from an existing project in Murano
11
11
  mkdir myproject
12
12
  cd myproject
13
13
  mr config solution.id XXXXXX
14
- mr syncdown -same
14
+ mr syncdown
15
15
  ```
16
16
 
17
- Do stuff, see what changed: `mr status -same` or `mr diff -same`.
18
- Then deploy `mr syncup -same`
17
+ Do stuff, see what changed: `mr status` or `mr diff`.
18
+ Then deploy with `mr syncup`
19
+
19
20
 
20
21
 
21
22
 
data/TODO.taskpaper CHANGED
@@ -33,7 +33,7 @@ Config:
33
33
 
34
34
  SolutionBase:
35
35
  - All network traffic is serialized. Make some parallel.
36
- - Add the --curl verbose option.
36
+ - Add the --curl verbose option. @done(2016-08-12)
37
37
  - Rebuild how local names and paths are computed from remote items. @done(2016-07-27)
38
38
 
39
39
  Bundles:
data/bin/mr CHANGED
@@ -16,6 +16,9 @@ global_option('-n', '--dry', %{Don't run actions that make changes}) {
16
16
  $cfg['tool.dry'] = true
17
17
  $cfg['tool.verbose'] = true # dry implies verbose
18
18
  }
19
+ global_option('-L', '--curl', 'Print out a curl command for each network call') {
20
+ $cfg['tool.curldebug'] = true
21
+ }
19
22
  global_option '--skip-plugins', %{Don't load plugins. Good for when one goes bad.}
20
23
 
21
24
  global_option('-C', '--configfile FILE', %{Load additional configuration file}) {|file|
@@ -49,7 +52,7 @@ pgds = [
49
52
  if not ARGV.include? '--skip-plugins' then
50
53
  pgds << Pathname.new(ENV['MR_MURANO_PLUGIN_DIR']) if ENV.has_key? 'MR_MURANO_PLUGIN_DIR'
51
54
  pgds.each do |path|
52
- next unless path.exist?
55
+ ext unless path.exist?
53
56
  path.each_child do |plugin|
54
57
  next if plugin.directory?
55
58
  next unless plugin.readable?
@@ -51,6 +51,14 @@ module MrMurano
51
51
  delete('/'+path)
52
52
  end
53
53
 
54
+ def curldebug(request)
55
+ # The upload will get printed out inside of upload.
56
+ # Because we don't have the correct info here.
57
+ if request.method != 'PUT' then
58
+ super(request)
59
+ end
60
+ end
61
+
54
62
  ##
55
63
  # Upload a file
56
64
  def upload(local, remote)
@@ -78,6 +86,16 @@ module MrMurano
78
86
  request.content_length = form.content_length
79
87
  request.body = form.to_s
80
88
 
89
+ if $cfg['tool.curldebug'] then
90
+ a = []
91
+ a << %{curl -s -H 'Authorization: #{request['authorization']}'}
92
+ a << %{-H 'User-Agent: #{request['User-Agent']}'}
93
+ a << %{-X #{request.method}}
94
+ a << %{'#{request.uri.to_s}'}
95
+ a << %{-F file=@#{local.to_s}}
96
+ puts a.join(' ')
97
+ end
98
+
81
99
  response = http.request(request)
82
100
  case response
83
101
  when Net::HTTPSuccess
@@ -123,7 +141,9 @@ module MrMurano
123
141
  end
124
142
  raise "Not a directory: #{from.to_s}" unless from.directory?
125
143
 
126
- Pathname.glob(from.to_s + '/**/*').map do |path|
144
+ Pathname.glob(from.to_s + '/**/*').reject do |path|
145
+ path.directory?
146
+ end.map do |path|
127
147
  name = toRemoteItem(from, path)
128
148
  name[:local_path] = path
129
149
  name
@@ -24,6 +24,19 @@ module MrMurano
24
24
  end
25
25
  end
26
26
 
27
+ def curldebug(request)
28
+ if $cfg['tool.curldebug'] then
29
+ a = []
30
+ a << %{curl -s -H 'Authorization: #{request['authorization']}'}
31
+ a << %{-H 'User-Agent: #{request['User-Agent']}'}
32
+ a << %{-H 'Content-Type: #{request.content_type}'}
33
+ a << %{-X #{request.method}}
34
+ a << %{'#{request.uri.to_s}'}
35
+ a << %{-d '#{request.body}'} unless request.body.nil?
36
+ puts a.join(' ')
37
+ end
38
+ end
39
+
27
40
  def endPoint(path='')
28
41
  parts = ['https:/', $cfg['net.host'], 'api:1'] + @uriparts
29
42
  s = parts.map{|v| v.to_s}.join('/')
@@ -48,6 +61,7 @@ module MrMurano
48
61
 
49
62
  def workit(request, &block)
50
63
  set_req_defaults(request)
64
+ curldebug(request)
51
65
  if block_given? then
52
66
  yield request, http()
53
67
  else
@@ -1,4 +1,4 @@
1
1
  module MrMurano
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.1.2'.freeze
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MrMurano
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Conrad Tadpol Tilstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-12 00:00:00.000000000 Z
11
+ date: 2016-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander