webconsole 0.1.16 → 0.1.17

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: e02e38e352341a42a5d9524a80ff626dc71f8d04
4
- data.tar.gz: 2239ff3a001e9af4d0e4baeb1153ff84a5e004d2
3
+ metadata.gz: 4207b87480240b927483e09752b8a2bf2912ec60
4
+ data.tar.gz: c95f3d9d2b1eccb267495a1bf0a0f57becff2f5a
5
5
  SHA512:
6
- metadata.gz: a45b3318abdc94bf74fe2469f61c465de8a76ff5f967b5139d36af196b7dc3351aebe756b81569fdd5d1ae248f181feaf07cd9c5d21acfd7da51a8a8c5b1c843
7
- data.tar.gz: e351006eb557422f1e7117abc72ac37d3b1f5098363f86dcf863c273d37df4092975aa7342c9d588fe04c3a86a75eeb47b99ae5470ca1f639cad66792b78a0fd
6
+ metadata.gz: 82ac6794349e1afaa72103f720ccff582f58fe3cc9aec781b9ad6c59cbc2f7dd782c8d2ee09e287ab9ab3343a879f3f2d8297d31497df062c38975712f5c1aff
7
+ data.tar.gz: d4c60721533c51ee36f02eb0e8a3717f1a6aebab62927d2063fbab475726208e682a6f00be995fcf63419a903054ad08fb819478d069d950fa849c3211ca71d5
@@ -8,7 +8,6 @@ module WebConsole
8
8
  EXISTS_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "exists.scpt")
9
9
  def self.application_exists
10
10
  result = self.run_applescript(EXISTS_SCRIPT)
11
- result.chomp!
12
11
  if result == "true"
13
12
  return true
14
13
  else
@@ -25,30 +24,19 @@ module WebConsole
25
24
  if arguments
26
25
  parameters = parameters + arguments
27
26
  end
28
- result = self.run_applescript(RUN_PLUGIN_SCRIPT, parameters)
29
- result.chomp!
30
- return result
27
+
28
+ return self.run_applescript(RUN_PLUGIN_SCRIPT, parameters)
31
29
  end
32
30
 
33
31
  RUN_PLUGIN_IN_SPLIT_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "run_plugin_in_split.scpt")
34
32
  def self.run_plugin_in_split(name, window_id, split_id)
35
33
  parameters = [name, window_id, split_id]
36
- result = self.run_applescript(RUN_PLUGIN_IN_SPLIT_SCRIPT, parameters)
37
- result.chomp!
38
- return result
34
+ return self.run_applescript(RUN_PLUGIN_IN_SPLIT_SCRIPT, parameters)
39
35
  end
40
36
 
41
37
  WINDOW_ID_FOR_PLUGIN_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "window_id_for_plugin.scpt")
42
38
  def self.window_id_for_plugin(name)
43
- result = self.run_applescript(WINDOW_ID_FOR_PLUGIN_SCRIPT, [name])
44
- result.chomp!
45
-
46
- if result.empty?
47
- # TODO: Remove this when doing `run_applescript` refactor
48
- return nil
49
- end
50
-
51
- return result
39
+ return self.run_applescript(WINDOW_ID_FOR_PLUGIN_SCRIPT, [name])
52
40
  end
53
41
 
54
42
  SPLIT_ID_IN_WINDOW_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "split_id_in_window.scpt")
@@ -59,39 +47,25 @@ module WebConsole
59
47
  arguments.push(pluginName)
60
48
  end
61
49
 
62
- result = self.run_applescript(SPLIT_ID_IN_WINDOW_SCRIPT, arguments)
63
- result.chomp!
64
-
65
- if result.empty?
66
- # TODO: Remove this when doing `run_applescript` refactor
67
- return nil
68
- end
69
-
70
- return result
50
+ return self.run_applescript(SPLIT_ID_IN_WINDOW_SCRIPT, arguments)
71
51
  end
72
52
 
73
53
  SPLIT_ID_IN_WINDOW_LAST_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "split_id_in_window_last.scpt")
74
54
  def self.split_id_in_window_last(window_id)
75
55
  arguments = [window_id]
76
- result = self.run_applescript(SPLIT_ID_IN_WINDOW_LAST_SCRIPT, arguments)
77
- result.chomp!
78
- return result
56
+ return self.run_applescript(SPLIT_ID_IN_WINDOW_LAST_SCRIPT, arguments)
79
57
  end
80
58
 
81
59
  CREATE_WINDOW_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "create_window.scpt")
82
60
  def self.create_window
83
- result = self.run_applescript(CREATE_WINDOW_SCRIPT)
84
- result.chomp!
85
- return result
61
+ return self.run_applescript(CREATE_WINDOW_SCRIPT)
86
62
  end
87
63
 
88
64
  # Shared Resources
89
65
 
90
66
  RESOURCE_PATH_FOR_PLUGIN_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "resource_path_for_plugin.scpt")
91
67
  def self.resource_path_for_plugin(name)
92
- result = self.run_applescript(RESOURCE_PATH_FOR_PLUGIN_SCRIPT, [name])
93
- result.chomp!
94
- return result
68
+ return self.run_applescript(RESOURCE_PATH_FOR_PLUGIN_SCRIPT, [name])
95
69
  end
96
70
 
97
71
  # Shared Resource Path
@@ -116,9 +90,7 @@ module WebConsole
116
90
 
117
91
  RESOURCE_URL_FOR_PLUGIN_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "resource_url_for_plugin.scpt")
118
92
  def self.resource_url_for_plugin(name)
119
- result = self.run_applescript(RESOURCE_URL_FOR_PLUGIN_SCRIPT, [name])
120
- result.chomp!
121
- return result
93
+ return self.run_applescript(RESOURCE_URL_FOR_PLUGIN_SCRIPT, [name])
122
94
  end
123
95
  def self.shared_resources_url
124
96
  return resource_url_for_plugin(SHARED_RESOURCES_PLUGIN_NAME)
@@ -139,11 +111,43 @@ module WebConsole
139
111
 
140
112
  result = `#{command}`
141
113
 
142
- # TODO: Figure out a better way to do this when doing `run_applescript` refactor
143
- # if result.chomp.empty?
144
- # return nil
145
- # end
114
+ result.chomp!
115
+
116
+ if result.empty?
117
+ return nil
118
+ end
119
+
120
+ if result.is_integer?
121
+ return result.to_i
122
+ end
123
+
124
+ if result.is_float?
125
+ return result.to_f
126
+ end
146
127
 
147
128
  return result
148
129
  end
130
+
131
+ class ::String
132
+ def is_float?
133
+ !!Float(self) rescue false
134
+ end
135
+
136
+ def is_integer?
137
+ self.to_i.to_s == self
138
+ end
139
+ end
140
+
141
+ class ::Float
142
+ def javascript_argument
143
+ return self.to_s
144
+ end
145
+ end
146
+
147
+ class ::Integer
148
+ def javascript_argument
149
+ return self.to_s
150
+ end
151
+ end
152
+
149
153
  end
@@ -3,18 +3,7 @@ module WebConsole
3
3
 
4
4
  def do_javascript_function(function, arguments = nil)
5
5
  javascript = self.class.javascript_function(function, arguments)
6
- result = do_javascript(javascript)
7
- result.chomp!
8
-
9
- if result.is_integer?
10
- return result.to_i
11
- end
12
-
13
- if result.is_float?
14
- return result.to_f
15
- end
16
-
17
- return result
6
+ return do_javascript(javascript)
18
7
  end
19
8
 
20
9
  def self.javascript_function(function, arguments = nil)
@@ -52,26 +41,6 @@ module WebConsole
52
41
  def javascript_escape!
53
42
  replace(self.javascript_escape)
54
43
  end
55
-
56
- def is_float?
57
- !!Float(self) rescue false
58
- end
59
-
60
- def is_integer?
61
- self.to_i.to_s == self
62
- end
63
- end
64
-
65
- class ::Float
66
- def javascript_argument
67
- return self.to_s
68
- end
69
- end
70
-
71
- class ::Integer
72
- def javascript_argument
73
- return self.to_s
74
- end
75
44
  end
76
45
 
77
46
  end
@@ -76,6 +76,5 @@ module WebConsole
76
76
  return arguments
77
77
  end
78
78
 
79
-
80
79
  end
81
80
  end
@@ -13,16 +13,15 @@ class TestViewHelper
13
13
  end
14
14
 
15
15
  def number_of_log_messages
16
- # TODO: Do JavaScript should coerce types
17
- return @view.do_javascript(TEST_MESSAGE_COUNT_JAVASCRIPT).chomp.to_i
16
+ return @view.do_javascript(TEST_MESSAGE_COUNT_JAVASCRIPT)
18
17
  end
19
18
 
20
19
  def last_log_message
21
- return @view.do_javascript(TEST_MESSAGE_JAVASCRIPT).chomp
20
+ return @view.do_javascript(TEST_MESSAGE_JAVASCRIPT)
22
21
  end
23
22
 
24
23
  def last_log_class
25
- return @view.do_javascript(TEST_CLASS_JAVASCRIPT).chomp
24
+ return @view.do_javascript(TEST_CLASS_JAVASCRIPT)
26
25
  end
27
26
 
28
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webconsole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roben Kleene
@@ -34,6 +34,8 @@ files:
34
34
  - lib/applescript/split_id_in_window_last.scpt
35
35
  - lib/applescript/toggle_log.scpt
36
36
  - lib/applescript/window_id_for_plugin.scpt
37
+ - lib/webconsole.rb
38
+ - lib/webconsole/dependencies.rb
37
39
  - lib/webconsole/dependencies/css/style.css
38
40
  - lib/webconsole/dependencies/js/wcdependencies.js
39
41
  - lib/webconsole/dependencies/lib/controller.rb
@@ -41,31 +43,29 @@ files:
41
43
  - lib/webconsole/dependencies/lib/tester.rb
42
44
  - lib/webconsole/dependencies/lib/view.rb
43
45
  - lib/webconsole/dependencies/views/view.html.erb
44
- - lib/webconsole/dependencies.rb
45
46
  - lib/webconsole/extension_constants.rb
46
47
  - lib/webconsole/lib/constants.rb
47
48
  - lib/webconsole/lib/controller.rb
48
49
  - lib/webconsole/lib/module.rb
50
+ - lib/webconsole/lib/view.rb
49
51
  - lib/webconsole/lib/view/erb.rb
50
52
  - lib/webconsole/lib/view/javascript.rb
51
53
  - lib/webconsole/lib/view/resources.rb
52
- - lib/webconsole/lib/view.rb
53
54
  - lib/webconsole/lib/window.rb
55
+ - lib/webconsole/logger.rb
56
+ - lib/webconsole/logger/test/Rakefile
54
57
  - lib/webconsole/logger/test/js/test_view_helper.js
55
58
  - lib/webconsole/logger/test/lib/test_constants.rb
56
59
  - lib/webconsole/logger/test/lib/test_view_helper.rb
57
- - lib/webconsole/logger/test/Rakefile
58
60
  - lib/webconsole/logger/test/run_tests.sh
59
61
  - lib/webconsole/logger/test/tc_logger.rb
60
- - lib/webconsole/logger.rb
62
+ - lib/webconsole/repl.rb
61
63
  - lib/webconsole/repl/css/style.css
62
64
  - lib/webconsole/repl/js/wcrepl.js
63
65
  - lib/webconsole/repl/lib/input_controller.rb
64
66
  - lib/webconsole/repl/lib/output_controller.rb
65
67
  - lib/webconsole/repl/lib/view.rb
66
68
  - lib/webconsole/repl/view/view.html.erb
67
- - lib/webconsole/repl.rb
68
- - lib/webconsole.rb
69
69
  homepage:
70
70
  licenses: []
71
71
  metadata: {}
@@ -75,17 +75,17 @@ require_paths:
75
75
  - lib
76
76
  required_ruby_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - ~>
78
+ - - "~>"
79
79
  - !ruby/object:Gem::Version
80
80
  version: '2.0'
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - '>='
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
87
  rubyforge_project:
88
- rubygems_version: 2.0.3
88
+ rubygems_version: 2.2.2
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: Web Console helper gem