pryline 0.0.3 → 0.0.4

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pryline.rb +49 -0
  3. data/lib/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00d0e3f6070b5bd54caa45cb04ba56714e4cca15221d78550a1ebb27030dac68
4
- data.tar.gz: 33d2fe2e6b4064d44f7123e4b093343e4f2d0769b1fd49d15a6dd70e7c41bb1a
3
+ metadata.gz: e87928b336c07a89688bd40bbcc3b2b151f10c650542964bb5577ddbc23c554f
4
+ data.tar.gz: 7974b43eb0a56435b2bbeb7079db7f196bdd9f505575af8de15ccf89461b593d
5
5
  SHA512:
6
- metadata.gz: 6fa513cbf92763d350e058c8b7580557928c3084bb54a210a120f9e498c1babce29b0f260c82213b79d0762cbb6f4df252e0bad4bbf4146b14be665fa1be5b18
7
- data.tar.gz: 22bf0d2b6aa429baba849851c2d827874fb6afba3468319ef31a7ccd475254ed1975bc9683695e075cdc3adedcc6ff81017e0e1047688ec03e11ac18bae86284
6
+ metadata.gz: 00df8a6a07c27e7e76a4c7f687461655135500d963a1413582e6f0e8bfe6a396ab04dd469a50bc3f421fa93bd4605fef2fb180fa258428f043723280647b82e9
7
+ data.tar.gz: fd3f44e02221234f23497a6e365d5311ce583a4e80f2e4066909f9a50893e2f9c51599cfaf2bbf52ba4b5bbbbf45dccb5787624d85ae22e1a18b4438b23ed1ec
data/lib/pryline.rb CHANGED
@@ -61,6 +61,55 @@ module Pryline
61
61
  accept_line.call(1, "\n".ord)
62
62
  end
63
63
 
64
+ # previous line
65
+ previous_line = Fiddle::Function.new(
66
+ libreadline['rl_previous_screen_line'],
67
+ [Fiddle::TYPE_INT, Fiddle::TYPE_INT],
68
+ Fiddle::TYPE_INT
69
+ )
70
+ Pryline.define_singleton_method(:previous_line) do
71
+ previous_line.call(1, "f".ord)
72
+ end
73
+
74
+ # next line
75
+ next_line = Fiddle::Function.new(
76
+ libreadline['rl_next_screen_line'],
77
+ [Fiddle::TYPE_INT, Fiddle::TYPE_INT],
78
+ Fiddle::TYPE_INT
79
+ )
80
+ Pryline.define_singleton_method(:next_line) do
81
+ next_line.call(1, "f".ord)
82
+ end
83
+
84
+ # next history
85
+ next_history = Fiddle::Function.new(
86
+ libreadline['rl_get_next_history'],
87
+ [Fiddle::TYPE_INT, Fiddle::TYPE_INT],
88
+ Fiddle::TYPE_INT
89
+ )
90
+ Pryline.define_singleton_method(:next_history) do
91
+ next_history.call(1, "f".ord)
92
+ end
93
+
94
+ # previous history
95
+ previous_history = Fiddle::Function.new(
96
+ libreadline['rl_get_previous_history'],
97
+ [Fiddle::TYPE_INT, Fiddle::TYPE_INT],
98
+ Fiddle::TYPE_INT
99
+ )
100
+ Pryline.define_singleton_method(:previous_history) do
101
+ previous_history.call(1, "f".ord)
102
+ end
103
+
104
+ where_history = Fiddle::Function.new(
105
+ libreadline['where_history'],
106
+ [Fiddle::TYPE_VOID],
107
+ Fiddle::TYPE_INT
108
+ )
109
+ Pryline.define_singleton_method(:where_history) do
110
+ where_history.call(nil)
111
+ end
112
+
64
113
  # null function
65
114
  null_function = Fiddle::Function.new(
66
115
  libreadline['_rl_null_function'],
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pryline
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pryline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Graham