ood_appkit 1.0.0 → 1.0.1

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: 639be3508b4fec095c35a5d4975b786d1ec8b4dd
4
- data.tar.gz: 772b0ddc945ae9a38247c68fde45a611627b08f2
3
+ metadata.gz: e93d18a9dde285e2ea4192e6432c335fb7a8f0f6
4
+ data.tar.gz: 064f4bea76929a57b553bcd3b9cba6f9b55407af
5
5
  SHA512:
6
- metadata.gz: 00d0a0e9c72158520b4a7fa8bf7350134e321fb32fb3baea420d74ec5b912b32988e052c37231aec5bed0585ce8a1d0337e8bf46855982c69dd698b52eff40f2
7
- data.tar.gz: 62d4891cac215848b39c1668582360ebe2749edfa224db14453c139d85bf0db61d2cf5b57f0013fbad2fe6130895df5952c146ee0b54d22fe86f418d34d4b880
6
+ metadata.gz: db8d0a58f9555aeed9dc4bd5a96fa826f34994fe78c45c913b608fe10ddebdf2ac4bacf8cd9bc7a0729eec344c8764099708a1bef844973f35d40acd0c87259b
7
+ data.tar.gz: dd1715a1ee4d7c5403344c4d84cc6a5f668d70a51187980bee0bbb599278e4297d0a6d2603f9991e5e6b674b98872d84cc0eac5e9843df24a3f9523439ce2748
@@ -10,10 +10,16 @@ module OodAppkit
10
10
  end
11
11
 
12
12
  # URL to access this app's file editor API for a given absolute file path
13
- # @param path [#to_s] the absolute path to the file on the filesystem
14
- # @return [Addressable::URI] absolute url to access path in file editor api
15
- def edit(path: '')
16
- @template.expand url: @base_url + @edit_url, path: path.to_s
13
+ # @param opts [#to_h] the available options for this method
14
+ # @option opts [#to_s, nil] :path ("") The absolute path to the file on
15
+ # the filesystem
16
+ # @return [Addressable::URI] absolute url to access path in file editor
17
+ # api
18
+ def edit(opts = {})
19
+ opts = opts.to_h.compact.symbolize_keys
20
+
21
+ path = opts.fetch(:path, "").to_s
22
+ @template.expand url: @base_url + @edit_url, path: path
17
23
  end
18
24
  end
19
25
  end
@@ -12,17 +12,27 @@ module OodAppkit
12
12
  end
13
13
 
14
14
  # URL to access this app for a given absolute file path
15
- # @param path [#to_s] the absolute path to the file on the filesystem
16
- # @return [Addressable::URI] absolute url to access path in files app
17
- def url(path: '')
18
- @template.expand url: @base_url + @fs_url, path: path.to_s
15
+ # @param opts [#to_h] the available options for this method
16
+ # @option opts [#to_s, nil] :path ("") The absolute path to the file on
17
+ # the filesystem
18
+ # @return [Addressable::URI] absolute url to access path in file app
19
+ def url(opts = {})
20
+ opts = opts.to_h.compact.symbolize_keys
21
+
22
+ path = opts.fetch(:path, "").to_s
23
+ @template.expand url: @base_url + @fs_url, path: path
19
24
  end
20
25
 
21
26
  # URL to access this app's API for a given absolute file path
22
- # @param path [#to_s] the absolute path to the file on the filesystem
27
+ # @param opts [#to_h] the available options for this method
28
+ # @option opts [#to_s, nil] :path ("") The absolute path to the file on
29
+ # the filesystem
23
30
  # @return [Addressable::URI] absolute url to access path in files app api
24
- def api(path: '')
25
- @template.expand url: @base_url + @api_url, path: path.to_s
31
+ def api(opts = {})
32
+ opts = opts.to_h.compact.symbolize_keys
33
+
34
+ path = opts.fetch(:path, "").to_s
35
+ @template.expand url: @base_url + @api_url, path: path
26
36
  end
27
37
  end
28
38
  end
@@ -10,11 +10,18 @@ module OodAppkit
10
10
  end
11
11
 
12
12
  # URL to access this app for a given host and absolute file path
13
- # @param host [#to_s] the host the app will make an ssh connection with
14
- # @param path [#to_s] the absolute path to the directory ssh app opens up in
13
+ # @param opts [#to_h] the available options for this method
14
+ # @option opts [#to_s, nil] :host ("default") The host the app will make
15
+ # an ssh connection to
16
+ # @option opts [#to_s, nil] :path ("") The absolute path to the directory
17
+ # the ssh app opens up in
15
18
  # @return [Addressable::URI] the url used to access the app
16
- def url(host: 'default', path: '')
17
- @template.expand url: @base_url + @ssh_url, host: host.to_s, path: path.to_s
19
+ def url(opts = {})
20
+ opts = opts.to_h.compact.symbolize_keys
21
+
22
+ host = opts.fetch(:host, "default").to_s
23
+ path = opts.fetch(:path, "").to_s
24
+ @template.expand url: @base_url + @ssh_url, host: host, path: path
18
25
  end
19
26
  end
20
27
  end
@@ -1,4 +1,4 @@
1
1
  module OodAppkit
2
2
  # The current version of OodAppkit
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ood_appkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Franz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-17 00:00:00.000000000 Z
12
+ date: 2017-04-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails