From d907f3771934aa0ea12e8a29e41c112ebbfe007e Mon Sep 17 00:00:00 2001 From: Watson Date: Mon, 20 May 2024 02:07:08 +0900 Subject: [PATCH] Update execution result style in example code (#30) --- draw.html | 26 +++++++++++++------------- ilist.html | 28 +++++++++++++++------------- image1.html | 21 +++++++++++---------- image2.html | 14 +++++++------- image3.html | 17 +++++++++-------- info.html | 9 +++++---- magick.html | 18 +++++++++--------- 7 files changed, 69 insertions(+), 64 deletions(-) diff --git a/draw.html b/draw.html index e415490..5f115ba 100644 --- a/draw.html +++ b/draw.html @@ -816,14 +816,14 @@

Description

Example

-draw.inspect »
-   "stroke red
-    fill transparent
-    rectangle 20,20 380,180
-    line 200,20 200,180
-    line 20,100 380,100
-    stroke transparent
-    fill black"
+draw.inspect
+  #=> "stroke red
+  #   fill transparent
+  #   rectangle 20,20 380,180
+  #   line 200,20 200,180
+  #   line 20,100 380,100
+  #   stroke transparent
+  #   fill black"
 
@@ -2700,12 +2700,12 @@

Returns

Quoting examples

-

The text to the right of » is the text that will be drawn.

+

The text to the right of #=> is the text that will be drawn.

-gc.text(10,10, '"Hello there!"') » Hello there!
-gc.text(10,10, "'What\'s up?'") » What's up?
-gc.text(10,10, %q/"What's up?"/) » What's up?
-gc.text(10,10, %q/{"What's up?"}/) » "What's up?"
+gc.text(10,10, '"Hello there!"')   #=> Hello there!
+gc.text(10,10, "'What\'s up?'")    #=> What's up?
+gc.text(10,10, %q/"What's up?"/)   #=> What's up?
+gc.text(10,10, %q/{"What's up?"}/) #=> "What's up?"
 
diff --git a/ilist.html b/ilist.html index b9a4b6e..0d8c055 100644 --- a/ilist.html +++ b/ilist.html @@ -248,7 +248,7 @@

Example

 i = Magick::ImageList.new("images/Button_A.gif", "images/Button_B.gif")
-i.length » 2
+i.length #=> 2
 
@@ -271,7 +271,7 @@

Example

 ilist.scene = 10
-ilist.scene » 10
+ilist.scene #=> 10
 
@@ -1015,9 +1015,9 @@

Example

 i = Magick::ImageList.new("images/Button_A.gif", "images/Button_B.gif")
-» [images/Button_A.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 18136b
-images/Button_B.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 5157b]
-scene=1
+#=> [images/Button_A.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 18136b
+#   images/Button_B.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 5157b]
+#   scene=1
 
@@ -1533,8 +1533,8 @@

Example

 ilist = Magick::ImageList.new
 ilist.ping "Button_A.gif"
-puts "The image has #{i.columns} columns and #{i.rows} rows." »
-      The image has 127 columns and 120 rows.
+puts "The image has #{i.columns} columns and #{i.rows} rows."
+#=> The image has 127 columns and 120 rows.
 
@@ -1789,7 +1789,7 @@

Example

 i = Magick::ImageList.new "birthday.png"
-s = i.to_blob » a string representing the image.
+s = i.to_blob #=> a string representing the image.
 
@@ -1873,13 +1873,15 @@

Example

# The PNG format does not support multi-frame files, # so each image is written to a separate file. i = Magick::ImageList.new "animated.gif" -p i.length » 3 # contains 3 images -i.write "test.png" » test.png.0 - » test.png.1 - » test.png.2 +p i.length #=> 3 # contains 3 images +i.write "test.png" +#=> test.png.0 +# test.png.1 +# test.png.2 + # ImageMagick's MIFF format does support multi-frame # files, so all 3 images are written to one file. -i.write "animated.miff" » animated.miff +i.write "animated.miff" #=> animated.miff diff --git a/image1.html b/image1.html index 8c285ce..c06cac8 100644 --- a/image1.html +++ b/image1.html @@ -589,9 +589,9 @@

Returns

Example

-cheetah = Magick::Image.ping("Cheetah.jpg") » [Cheetah.jpg JPEG 1024x768 DirectClass 8-bit 101684b]
-p cheetah[0].rows » 768
-p cheetah[0].columns » 1024
+cheetah = Magick::Image.ping("Cheetah.jpg") #=> [Cheetah.jpg JPEG 1024x768 DirectClass 8-bit 101684b]
+p cheetah[0].rows    #=> 768
+p cheetah[0].columns #=> 1024
 
@@ -641,9 +641,10 @@

Returns

Example

-animated = Magick::Image.read("animated.gif") » [animated.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b
-                                              »  animated.gif[1] GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b,
-                                              »  animated.gif[2] GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b]
+animated = Magick::Image.read("animated.gif")
+#=> [animated.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b
+#   animated.gif[1] GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b,
+#   animated.gif[2] GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b]
 
@@ -3379,10 +3380,10 @@

Returns

Example

-f = Magick::Image.read('cbezier1.gif').first » cbezier1.gif GIF 500x350+0+0 PseudoClass 128c 8-bit 177503b
-f.colors » 128
-f.compress_colormap! » cbezier1.gif GIF 500x350+0+0 PseudoClass 108c 8-bit 177503b
-f.colors » 108
+f = Magick::Image.read('cbezier1.gif').first #=> cbezier1.gif GIF 500x350+0+0 PseudoClass 128c 8-bit 177503b
+f.colors #=> 128
+f.compress_colormap! #=> cbezier1.gif GIF 500x350+0+0 PseudoClass 108c 8-bit 177503b
+f.colors #=> 108
 
diff --git a/image2.html b/image2.html index 12a2bde..3264927 100644 --- a/image2.html +++ b/image2.html @@ -1352,9 +1352,9 @@

Returns

Example

-image.get_exif_by_entry('Make')              » [["Make", "Canon"]]
-image.get_exif_by_entry("ShutterSpeedValue") » [["ShutterSpeedValue", "189/32"]]
-image.get_exif_by_entry()                    » [["Make", "Canon"], ["ShutterSpeedValue", "189/32"] ...]
+image.get_exif_by_entry('Make')              #=> [["Make", "Canon"]]
+image.get_exif_by_entry("ShutterSpeedValue") #=> [["ShutterSpeedValue", "189/32"]]
+image.get_exif_by_entry()                    #=> [["Make", "Canon"], ["ShutterSpeedValue", "189/32"] ...]
 
@@ -1391,9 +1391,9 @@

Returns

Example

-image.get_exif_by_number(271)   » {271=>"Canon"}
-image.get_exif_by_number(37377) » {37377=>"189/32"}
-image.get_exif_by_number()      » {271=>"Canon", 37377=>"189/32" ...}
+image.get_exif_by_number(271)   #=> {271=>"Canon"}
+image.get_exif_by_number(37377) #=> {37377=>"189/32"}
+image.get_exif_by_number()      #=> {271=>"Canon", 37377=>"189/32" ...}
 
@@ -2296,7 +2296,7 @@

Description

Example

-
f.inspect » "images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9kb"
+
f.inspect #=> "images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9kb"
diff --git a/image3.html b/image3.html index 1a4bcdc..5e73fd1 100644 --- a/image3.html +++ b/image3.html @@ -2514,11 +2514,12 @@

Returns

Example

-img = Magick::Image.read('ex/images/Flower_Hat.jpg').first » ex/images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9761b
-img.properties » {"comment"=>"File written by Adobe Photoshop\250 4.0"}
-img.signature  » "485e01ecba1a1f47924d67b887cb07b474f695841733796dfa3c2876965c7e8b"
-img.properties » {"signature"=>"485e01ecba1a1f47924d67b887cb07b474f695841733796dfa3c2876965c7e8b",
-               » "comment"=>"File written by Adobe Photoshop\250 4.0"}
+img = Magick::Image.read('ex/images/Flower_Hat.jpg').first #=> ex/images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9761b
+img.properties #=> {"comment"=>"File written by Adobe Photoshop\250 4.0"}
+img.signature  #=> "485e01ecba1a1f47924d67b887cb07b474f695841733796dfa3c2876965c7e8b"
+img.properties
+#=> {"signature"=>"485e01ecba1a1f47924d67b887cb07b474f695841733796dfa3c2876965c7e8b",
+#   "comment"=>"File written by Adobe Photoshop\250 4.0"}
 
@@ -3381,9 +3382,9 @@

Returns

Example

-img = Magick::Image.read('ex/images/Flower_Hat.jpg').first » ex/images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9761b
-pixel = img.pixel_color(img.columns/2, img.rows/2)         » #<struct Pixel red=216, green=147, blue=106, opacity=0>
-img.to_color(pixel)                                        » "#D8936A"
+img = Magick::Image.read('ex/images/Flower_Hat.jpg').first #=> ex/images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9761b
+pixel = img.pixel_color(img.columns/2, img.rows/2)         #=> #<struct Pixel red=216, green=147, blue=106, opacity=0>
+img.to_color(pixel)                                        #=> "#D8936A"
 
diff --git a/info.html b/info.html index ed9343f..9c93d95 100644 --- a/info.html +++ b/info.html @@ -255,7 +255,8 @@

The "user" option

 img = Magick::Image.new(10,10) do |options|
   options['user'] = __FILE__ + ':' + __LINE__.to_s
-end » 10x10 DirectClass 16-bit user:test.rb:3
+end
+#=> 10x10 DirectClass 16-bit user:test.rb:3
 
@@ -313,7 +314,7 @@

Returns

Example

-
options["tiff", "bits-per-sample"] » 2
+
options["tiff", "bits-per-sample"] #=> 2

Magick API

@@ -520,8 +521,8 @@

Description

options.caption = "a new caption" options.size = "20x20" end -p img.first.properties » {"caption"=>"a new caption"} -p img.first['caption'] » "a new caption" +p img.first.properties #=> {"caption"=>"a new caption"} +p img.first['caption'] #=> "a new caption" diff --git a/magick.html b/magick.html index 6516c4a..82d4140 100644 --- a/magick.html +++ b/magick.html @@ -284,15 +284,15 @@

Returns

Example

-p Magick.formats »
-   {"TIF"=>"*rw+",
-   "H"=>"*rw-",
-   "MNG"=>"*rw+",
-   "NULL"=>"*rw-",
-   ...
-   "G"=>"*rw+",
-   "GIF"=>"*rw+",
-   "PDB"=>"*rw+"}
+p Magick.formats
+#=> {"TIF"=>"*rw+",
+#  "H"=>"*rw-",
+#  "MNG"=>"*rw+",
+#  "NULL"=>"*rw-",
+#  ...
+#  "G"=>"*rw+",
+#  "GIF"=>"*rw+",
+#  "PDB"=>"*rw+"}