vterm 0.0.4 → 0.0.5

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
  SHA256:
3
- metadata.gz: da6e45817a66c11a61b009affb22252a617634872f0ae4ad1f138eb8ed2cc6b9
4
- data.tar.gz: aaf3c82c2d01951a134888fbbb1ad613d097f2334613590814f23ebb9c151437
3
+ metadata.gz: 70b90530328a682cb155b77a1873cc2dbbe6b19bdf52c8efa08c9da445382d94
4
+ data.tar.gz: bf32741150f2ace60187236950e8ccbb2333ac8dce2494eb86bdbc74f7e71a17
5
5
  SHA512:
6
- metadata.gz: 364ad924e5f4c70724ffe836009f5eb0c081589cea007ec443d020611b0d21751e1530aa7021e18f68219959d831403c9b8360e5497b1894c1bd4cf5ea504f15
7
- data.tar.gz: e2314697d012eedfe76d0d6f05e9c39c172ff0941cbbef6ea11f2d0a18560b9ca6dcefe4afd1f2f33cff9100136250d391ff8d1205e7fbe8a9c843c91584efc4
6
+ metadata.gz: 9606139d19fb5843b3c723eaae2e570512b896c5aca8833a293120a2f82fba0fb5b442daa70328466d243c7038765efe3aea27f7aaebd3d24bb05e6ae21bbff8
7
+ data.tar.gz: 7db6fd09a406ba6fdd240df4587757fe9581c12346e1adb89c852551175808f2c0d9fbcc5e375f0be513f1ab5327b94f50b533a951fd6988054aa5983c77b9c2
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 aycabta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
- # Libvterm
1
+ ![GitHub Actions status](https://github.com/aycabta/vterm-gem/workflows/CI/badge.svg)
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/libvterm`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ # VTerm
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ This is a libvterm Ruby binding.
6
6
 
7
7
  ## Installation
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'libvterm'
12
+ gem 'vterm'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -18,11 +18,11 @@ And then execute:
18
18
 
19
19
  Or install it yourself as:
20
20
 
21
- $ gem install libvterm
21
+ $ gem install vterm
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ Please check test/test_vterm.rb.
26
26
 
27
27
  ## Development
28
28
 
@@ -32,4 +32,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
32
 
33
33
  ## Contributing
34
34
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/libvterm.
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/aycabta/vterm-gem.
data/ext/vterm/vterm.c CHANGED
@@ -129,12 +129,10 @@ rb_vterm_screen(VALUE self)
129
129
  {
130
130
  vterm_data_t *vt_data;
131
131
  vterm_screen_data_t *vt_screen_data;
132
- ID screen_new_id;
133
132
  VALUE vt_screen;
134
133
 
135
134
  vt_data = (vterm_data_t*)DATA_PTR(self);
136
- screen_new_id = rb_intern("new");
137
- vt_screen = rb_funcall(cVTermScreen, screen_new_id, 0);
135
+ vt_screen = rb_vterm_screen_alloc(cVTermScreen);
138
136
 
139
137
  vt_screen_data = malloc(sizeof(vterm_screen_data_t));
140
138
  vt_screen_data->vtscreen = vterm_obtain_screen(vt_data->vt);
@@ -186,8 +184,7 @@ rb_vterm_read(int argc, VALUE *argv, VALUE self)
186
184
  bufsize = specified_size;
187
185
  }
188
186
  } else if (argc != 0) {
189
- // TODO argument error
190
- return Qnil;
187
+ rb_raise(rb_eArgError, "buffer size must be unspecified or only one");
191
188
  }
192
189
  if (bufsize == 0) {
193
190
  return rb_str_new_cstr("");
@@ -296,7 +293,6 @@ rb_vterm_screen_cell_at(VALUE self, VALUE row, VALUE col)
296
293
  result = vterm_screen_get_cell(vt_screen_data->vtscreen, pos, &cell);
297
294
  if (result == 0) {
298
295
  rb_raise(rb_eRuntimeError, "#cell_at error");
299
- return Qnil;
300
296
  }
301
297
  rb_attrs = rb_struct_new(
302
298
  sVTermScreenCellAttrs,
data/lib/vterm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class VTerm
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vterm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - aycabta
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-16 00:00:00.000000000 Z
11
+ date: 2021-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -74,20 +74,16 @@ extensions:
74
74
  - ext/vterm/extconf.rb
75
75
  extra_rdoc_files: []
76
76
  files:
77
- - ".gitignore"
78
- - Gemfile
77
+ - LICENSE.txt
79
78
  - README.md
80
- - Rakefile
81
- - bin/console
82
- - bin/setup
83
79
  - ext/vterm/extconf.rb
84
80
  - ext/vterm/vterm.c
85
81
  - lib/vterm/version.rb
86
- - vterm.gemspec
87
82
  homepage: https://github.com/aycabta/vterm-gem
88
- licenses: []
83
+ licenses:
84
+ - MIT
89
85
  metadata: {}
90
- post_install_message:
86
+ post_install_message:
91
87
  rdoc_options: []
92
88
  require_paths:
93
89
  - lib
@@ -102,8 +98,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
98
  - !ruby/object:Gem::Version
103
99
  version: '0'
104
100
  requirements: []
105
- rubygems_version: 3.1.2
106
- signing_key:
101
+ rubygems_version: 3.2.0.rc.1
102
+ signing_key:
107
103
  specification_version: 4
108
104
  summary: A wrapper library of libvterm
109
105
  test_files: []
data/.gitignore DELETED
@@ -1,13 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- *.swp
10
- Makefile
11
- mkmf.log
12
- vterm.o
13
- vterm.so
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in libvterm.gemspec
6
- gemspec
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- require 'bundler/gem_tasks'
2
-
3
- require 'rake/extensiontask'
4
- Rake::ExtensionTask.new('vterm')
5
-
6
- require 'rake/testtask'
7
- Rake::TestTask.new(:test) do |t|
8
- t.libs << 'lib'
9
- t.test_files = FileList['test/test_*.rb']
10
- end
11
-
12
- task :default => [:compile, :test]
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "libvterm"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/vterm.gemspec DELETED
@@ -1,30 +0,0 @@
1
-
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'vterm/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'vterm'
8
- spec.version = VTerm::VERSION
9
- spec.authors = ['aycabta']
10
- spec.email = ['aycabta@gmail.com']
11
-
12
- spec.summary = %q{A wrapper library of libvterm}
13
- spec.description = %q{A wrapper library of libvterm}
14
- spec.homepage = 'https://github.com/aycabta/vterm-gem'
15
- spec.extensions = %w[ext/vterm/extconf.rb]
16
-
17
- # Specify which files should be added to the gem when it is released.
18
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
- end
22
- spec.bindir = 'exe'
23
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
- spec.require_paths = ['lib']
25
-
26
- spec.add_development_dependency 'bundler'
27
- spec.add_development_dependency 'rake'
28
- spec.add_development_dependency 'rake-compiler'
29
- spec.add_development_dependency 'test-unit'
30
- end