gmt 0.0.10 → 0.0.11

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gmt.rb +28 -17
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83004af94b065d8ed5dcc96880f9f92eb24d9587
4
- data.tar.gz: c3c3b8a34eecbe5d65fdd434a9d79ed4fe3a2ebf
3
+ metadata.gz: 88539f5f8f1bc7eaa33cad667f4f34bc05af82b5
4
+ data.tar.gz: 9f731cf9dbfb6e09895f2ebc030ad9d599fa25fd
5
5
  SHA512:
6
- metadata.gz: 203784ecd104c0412a2c327c10457c1508754574e9a5dfb6224cf708ef8f438e4460b1a2118e76f49d0f63cb5378949aacfab5074e9800e5070357f9818fe1f1
7
- data.tar.gz: db221c721995a317e2dc78eb0e18247dc58c78006769715ded65aaea10ca96e24a5a7c1ecfffb86133983d3df027686f4997a007d4134515207e068af3375663
6
+ metadata.gz: 93f48be603b22f30cfd554e3ae78d8e037cd39a0505774a9756c2b048ba53274f587fa165647b7992c2eee1053603237f1818327cbf760428f637e38af322311
7
+ data.tar.gz: ee9b7af7e6e67a5334da37b78c7d69a1166f85dab656981a188040cf0be2e636cd5f3217914df9f91859158465e4fbc91bf9de8fb4a097499367468d9d87b299
data/lib/gmt.rb CHANGED
@@ -10,22 +10,20 @@
10
10
  #
11
11
  # require 'gmt'
12
12
  #
13
- # common = {
14
- # file: 'output.ps',
15
- # R: '0/3/0/2',
16
- # J: 'x1i'
17
- # }
18
- # gmt = GMT.new
19
- # gmt.psxy('dots.xy',
20
- # common.merge(
21
- # position: :first,
22
- # S: 'c0.50c',
23
- # G: 'blue'))
24
- # gmt.psxy('dots.xy',
25
- # common.merge(
26
- # position: :last,
27
- # S: 'c0.25c',
28
- # G: 'red'))
13
+ # common = { file: 'output.ps', R: '0/3/0/2', J: 'x1i' }
14
+ #
15
+ # GMT.session do |gmt|
16
+ # gmt.psxy('dots.xy',
17
+ # common.merge(
18
+ # position: :first,
19
+ # S: 'c0.50c',
20
+ # G: 'blue'))
21
+ # gmt.psxy('dots.xy',
22
+ # common.merge(
23
+ # position: :last,
24
+ # S: 'c0.25c',
25
+ # G: 'red'))
26
+ # end
29
27
  #
30
28
  # Those familiar with GMT will recognise the +-R+ (range) and +-J+ (projection)
31
29
  # options which are now keys for the program options hash.
@@ -39,6 +37,12 @@
39
37
  #
40
38
  # There are no arguments for the constructor.
41
39
  #
40
+ # A session object is also yielded by the {GMT.session} class method:
41
+ #
42
+ # GMT.session do |gmt|
43
+ # # do something with gmt
44
+ # end
45
+ #
42
46
  # == GMT functions
43
47
  #
44
48
  # Each GMT function is available as instance method, and each has the same
@@ -55,7 +59,7 @@
55
59
  # :C => 'gebco', :i => 2, :Z => nil, :E => 24, :> => 'my_depths.cpt')
56
60
  #
57
61
  # Note that
58
- # - the single argument (the input file <code>'depths.txt'</code>) preceeds
62
+ # - the argument(s) (the input file <code>'depths.txt'</code>) preceed(s)
59
63
  # the options hash
60
64
  # - the options hash has keys which are symbols
61
65
  # - options which lack arguments correspond to hash keys with nil values
@@ -120,6 +124,13 @@ class GMT
120
124
  end
121
125
  end
122
126
 
127
+ public
128
+
129
+ # @yield [gmt] yields the {GMT} session to the block
130
+ def session(&block)
131
+ yield GMT.new
132
+ end
133
+
123
134
  end
124
135
 
125
136
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.J. Green