summaryrefslogtreecommitdiff
path: root/ext/json/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/lib')
-rw-r--r--ext/json/lib/json.rb6
-rw-r--r--ext/json/lib/json/common.rb2
-rw-r--r--ext/json/lib/json/editor.rb32
-rw-r--r--ext/json/lib/json/pure/generator.rb8
-rw-r--r--ext/json/lib/json/pure/parser.rb4
5 files changed, 26 insertions, 26 deletions
diff --git a/ext/json/lib/json.rb b/ext/json/lib/json.rb
index 3b0b711550..640baaebb6 100644
--- a/ext/json/lib/json.rb
+++ b/ext/json/lib/json.rb
@@ -48,7 +48,7 @@ require 'json/common'
# * http://json.rubyforge.org
#
# == Usage
-#
+#
# To use JSON you can
# require 'json'
# to load the installed variant (either the extension 'json' or the pure
@@ -141,7 +141,7 @@ require 'json/common'
#
# JSON.parse json
# # => [1, 2, {"a"=>3.141}, false, true, nil, "4..10"]
-#
+#
# Note, that the range from the original data structure is a simple
# string now. The reason for this is, that JSON doesn't support ranges
# or arbitrary classes. In this case the json library falls back to call
@@ -170,7 +170,7 @@ require 'json/common'
# if the given class responds to the json_create class method. If so, it is
# called with the JSON object converted to a Ruby hash. So a range can
# be deserialised by implementing Range.json_create like this:
-#
+#
# class Range
# def self.json_create(o)
# new(*o['data'])
diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb
index 499fcc0dae..1bd0ad5fbd 100644
--- a/ext/json/lib/json/common.rb
+++ b/ext/json/lib/json/common.rb
@@ -160,7 +160,7 @@ module JSON
# * *indent*: a string used to indent levels (default: ''),
# * *space*: a string that is put after, a : or , delimiter (default: ''),
# * *space_before*: a string that is put before a : pair delimiter (default: ''),
- # * *object_nl*: a string that is put at the end of a JSON object (default: ''),
+ # * *object_nl*: a string that is put at the end of a JSON object (default: ''),
# * *array_nl*: a string that is put at the end of a JSON array (default: ''),
# * *check_circular*: true if checking for circular data structures
# should be done (the default), false otherwise.
diff --git a/ext/json/lib/json/editor.rb b/ext/json/lib/json/editor.rb
index 12a7f94591..ad86fdb15e 100644
--- a/ext/json/lib/json/editor.rb
+++ b/ext/json/lib/json/editor.rb
@@ -48,14 +48,14 @@ module JSON
# Opens an error dialog on top of _window_ showing the error message
# _text_.
def Editor.error_dialog(window, text)
- dialog = MessageDialog.new(window, Dialog::MODAL,
- MessageDialog::ERROR,
+ dialog = MessageDialog.new(window, Dialog::MODAL,
+ MessageDialog::ERROR,
MessageDialog::BUTTONS_CLOSE, text)
dialog.show_all
dialog.run
rescue TypeError
- dialog = MessageDialog.new(Editor.window, Dialog::MODAL,
- MessageDialog::ERROR,
+ dialog = MessageDialog.new(Editor.window, Dialog::MODAL,
+ MessageDialog::ERROR,
MessageDialog::BUTTONS_CLOSE, text)
dialog.show_all
dialog.run
@@ -67,8 +67,8 @@ module JSON
# message _text_. If yes was answered _true_ is returned, otherwise
# _false_.
def Editor.question_dialog(window, text)
- dialog = MessageDialog.new(window, Dialog::MODAL,
- MessageDialog::QUESTION,
+ dialog = MessageDialog.new(window, Dialog::MODAL,
+ MessageDialog::QUESTION,
MessageDialog::BUTTONS_YES_NO, text)
dialog.show_all
dialog.run do |response|
@@ -465,7 +465,7 @@ module JSON
add_separator
add_item("Append new node", ?a, &method(:append_new_node))
add_item("Insert new node before", ?i, &method(:insert_new_node))
- add_separator
+ add_separator
add_item("Collapse/Expand node (recursively)", ?e,
&method(:collapse_expand))
@@ -504,7 +504,7 @@ module JSON
# Revert the current JSON document in the editor to the saved version.
def revert(item)
window.instance_eval do
- @filename and file_open(@filename)
+ @filename and file_open(@filename)
end
end
@@ -666,7 +666,7 @@ module JSON
collapse_all
else
self.expanded = true
- expand_all
+ expand_all
end
end
@@ -880,7 +880,7 @@ module JSON
dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
dialog.show_all
self.focus = dialog
- dialog.run do |response|
+ dialog.run do |response|
if response == Dialog::RESPONSE_ACCEPT
@key = key_input.text
type = ALL_TYPES[@type = type_input.active]
@@ -932,7 +932,7 @@ module JSON
dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
dialog.show_all
self.focus = dialog
- dialog.run do |response|
+ dialog.run do |response|
if response == Dialog::RESPONSE_ACCEPT
type = types[type_input.active]
@content = case type
@@ -973,7 +973,7 @@ module JSON
dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
dialog.show_all
self.focus = dialog
- dialog.run do |response|
+ dialog.run do |response|
if response == Dialog::RESPONSE_ACCEPT
return @order = order_input.text, reverse_checkbox.active?
end
@@ -1008,7 +1008,7 @@ module JSON
dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
dialog.show_all
self.focus = dialog
- dialog.run do |response|
+ dialog.run do |response|
if response == Dialog::RESPONSE_ACCEPT
begin
return Regexp.new(regex_input.text, icase_checkbox.active? ? Regexp::IGNORECASE : 0)
@@ -1207,7 +1207,7 @@ module JSON
end
end
- # Save the current file as the filename
+ # Save the current file as the filename
def file_save_as
filename = select_file('Save as a JSON file')
store_file(filename)
@@ -1233,7 +1233,7 @@ module JSON
rescue SystemCallError => e
Editor.error_dialog(self, "Failed to store JSON file: #{e}!")
end
-
+
# Load the file named _filename_ into the editor as a JSON document.
def load_file(filename)
if filename
@@ -1326,7 +1326,7 @@ module JSON
dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
dialog.show_all
- dialog.run do |response|
+ dialog.run do |response|
if response == Dialog::RESPONSE_ACCEPT
return @location = location_input.text
end
diff --git a/ext/json/lib/json/pure/generator.rb b/ext/json/lib/json/pure/generator.rb
index 9c7cfac0a2..4a9b05f545 100644
--- a/ext/json/lib/json/pure/generator.rb
+++ b/ext/json/lib/json/pure/generator.rb
@@ -86,7 +86,7 @@ module JSON
# * *indent*: a string used to indent levels (default: ''),
# * *space*: a string that is put after, a : or , delimiter (default: ''),
# * *space_before*: a string that is put before a : pair delimiter (default: ''),
- # * *object_nl*: a string that is put at the end of a JSON object (default: ''),
+ # * *object_nl*: a string that is put at the end of a JSON object (default: ''),
# * *array_nl*: a string that is put at the end of a JSON array (default: ''),
# * *check_circular*: true if checking for circular data structures
# should be done (the default), false otherwise.
@@ -148,13 +148,13 @@ module JSON
end
# Returns _true_, if _object_ was already seen during this generating
- # run.
+ # run.
def seen?(object)
@seen.key?(object.__id__)
end
# Remember _object_, to find out if it was already encountered (if a
- # cyclic data structure is if a cyclic data structure is rendered).
+ # cyclic data structure is if a cyclic data structure is rendered).
def remember(object)
@seen[object.__id__] = true
end
@@ -300,7 +300,7 @@ module JSON
json_shift(state, depth + 1) << value.to_json(state, depth + 1)
}.join(delim)
result << state.array_nl if state
- result << json_shift(state, depth)
+ result << json_shift(state, depth)
result << ']'
result
end
diff --git a/ext/json/lib/json/pure/parser.rb b/ext/json/lib/json/pure/parser.rb
index 9c3fea91da..f5ff574d11 100644
--- a/ext/json/lib/json/pure/parser.rb
+++ b/ext/json/lib/json/pure/parser.rb
@@ -39,7 +39,7 @@ module JSON
[^*/]| # normal chars
/[^*]| # slashes that do not start a nested comment
\*[^/]| # asterisks that do not end this comment
- /(?=\*/) # single slash before this comment's end
+ /(?=\*/) # single slash before this comment's end
)*
\*/ # the End of this comment
|[ \t\r\n]+ # whitespaces: space, horicontal tab, lf, cr
@@ -116,7 +116,7 @@ module JSON
?n => "\n",
?r => "\r",
?t => "\t",
- ?u => nil,
+ ?u => nil,
})
def parse_string