runeblog 0.0.66 → 0.0.67

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: adf4312a5e7a32552ee91aa3915429723f9ffbd6
4
- data.tar.gz: 157c726b6db5384507a8813df016f25f729d4574
3
+ metadata.gz: 312d4bc3515cf60d3bf2ae0f1531297e7929e44d
4
+ data.tar.gz: 94d91c4536bff9751544d93cd5b0a3e0292de8ce
5
5
  SHA512:
6
- metadata.gz: 3eaf87eec7fd56c1efc5fd586f0fd154667c353b63890e9807500bd992cd138c9a55b3d1d5ae8b5659fc2de018a48adf0cbaef3371476881afbb4fbfe6f7c453
7
- data.tar.gz: 58d33fe4ad47f8b0aaaa3e657b8a6a01755b6612dd8c65679cddf6cf61e58650d59ff0d2bb1a2ec321858fb0d12347d117632a2a5fb4b2d985dd11d3438685df
6
+ metadata.gz: 50df528cc615999d15e5e1875ac754c4443ce53ea8271a2eb8b834a3a50f796d3be7d485f0388462a41149c126424e2ac80da73104ab5939d2ad0213d7770dfb
7
+ data.tar.gz: 501a13eb07d84d70f85dd73dfe399d9a55d8de8369b5030d99545fe605fb68a7c5c4461c2f06154e3ba2b71093d036b66f9051ff70d26a4fe934545a580f3222
data/data/VERSION CHANGED
@@ -1 +1 @@
1
- RuneBlog v 0.0.66 2018-09-28
1
+ RuneBlog v 0.0.67 2018-09-29
data/lib/helpers-repl.rb CHANGED
@@ -197,6 +197,19 @@ module RuneBlog::REPL
197
197
  error(err)
198
198
  end
199
199
 
200
+ def ask_deployment_info # returns Deployment object
201
+ # user, server, root, path, protocol = "http"
202
+ puts "Please enter deployment data for view #{@blog.view}..."
203
+ user = ask("User: ")
204
+ root = ask("Doc root: ")
205
+ server = ask("Server: ")
206
+ path = ask("View path: ")
207
+ proto = ask("Protocol (ENTER for http): ")
208
+ [user, root, server, path, proto].each {|x| x.chomp! }
209
+ proto = "http" if proto.empty?
210
+ RuneBlog::Deployment.new(user, server, root, path, proto)
211
+ end
212
+
200
213
  ### find_asset
201
214
 
202
215
  # def find_asset(asset) # , views)
data/lib/repl.rb CHANGED
@@ -149,9 +149,12 @@ module RuneBlog::REPL
149
149
  rescue => err
150
150
  error(err)
151
151
  end
152
+
152
153
  def cmd_new_view(arg)
153
154
  reset_output
154
155
  @blog.create_view(arg)
156
+ depl = get_deployment_info
157
+ @blog.view(arg).deploy = depl
155
158
  nil
156
159
  rescue => err
157
160
  error(err)
data/lib/runeblog.rb CHANGED
@@ -20,7 +20,7 @@ def error(err) # FIXME - this is duplicated
20
20
  end
21
21
 
22
22
  class RuneBlog
23
- VERSION = "0.0.66"
23
+ VERSION = "0.0.67"
24
24
 
25
25
  class << self
26
26
  attr_accessor :blog
@@ -70,8 +70,8 @@ class RuneBlog
70
70
  views.any? {|x| x.name == name }
71
71
  end
72
72
 
73
- def view
74
- @view
73
+ def view(name = nil)
74
+ name.nil? ? @view : str2view(name)
75
75
  end
76
76
 
77
77
  def str2view(str)
@@ -346,7 +346,7 @@ class RuneBlog::View
346
346
  raise "RuneBlog.blog is not set!" if RuneBlog.blog.nil?
347
347
  @blog = RuneBlog.blog
348
348
  @name = name
349
- # How read deployment info??
349
+ @deploy = read_config
350
350
  end
351
351
 
352
352
  def dir
@@ -384,6 +384,18 @@ class RuneBlog::View
384
384
  def recent?(file)
385
385
  File.mtime(file) < File.mtime("#{dir()}/last_deployed")
386
386
  end
387
+
388
+ def read_config
389
+ file = self.dir + "/deploy"
390
+ lines = File.readlines(file).map(&:chomp)
391
+ user, server, root, path, proto = *lines
392
+ @deploy = RuneBlog::Deployment.new(user, server, root, path, proto)
393
+ end
394
+
395
+ def write_config
396
+ file = @blog.view.dir + "/deploy"
397
+ File.open(file) {|f| f.puts [@user, @server, @root, @path, @proto] }
398
+ end
387
399
  end
388
400
 
389
401
  #######
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.66
4
+ version: 0.0.67
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-28 00:00:00.000000000 Z
11
+ date: 2018-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext