lolruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 768a28317a4c2084e5bf87501142d888622efb75
4
+ data.tar.gz: 893396bebfd1c2b7c4bb4218169c24b06960ea71
5
+ SHA512:
6
+ metadata.gz: 2c608f8e2a3164720f5af88cd1f5deae667329c60e2f7dafaf06c0ccbbfc48e58cc3c17eb320d4b25630d5d380b71e4b13e2762998c234ce5bfed5aeb8343c6f
7
+ data.tar.gz: c8c4287df1dfe132b62663ca51873f7f80a53992609186a16713d392616fe2f4b617fbabdf4681f35483f6866d35676830af5275314a359e0e1a57819d01ba13
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.1
5
+ before_install: gem install bundler -v 1.15.4
data/Gemfile ADDED
@@ -0,0 +1,6 @@
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 lolruby.gemspec
6
+ gemspec
@@ -0,0 +1,55 @@
1
+ # Lolruby
2
+
3
+ [lolgopher](https://github.com/kris-nova/lolgopher) for Ruby.
4
+
5
+ NOTE: Go environment is required because this gem depends on golang extensions.
6
+
7
+ ![img](./img/1.png)
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'lolruby'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install lolruby
24
+
25
+ ## Usage
26
+
27
+ ```ruby
28
+ require 'lolruby'
29
+
30
+ lorem = <<EOL
31
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
32
+ Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
33
+ when an unknown printer took a galley of type and scrambled
34
+ it to make a type specimen book.
35
+ It has survived not only five centuries,
36
+ but also the leap into electronic typesetting,
37
+ remaining essentially unchanged.
38
+ It was popularised in the 1960s with the release of Letraset sheets
39
+ containing Lorem Ipsum passages,
40
+ and more recently with desktop publishing software
41
+ like Aldus PageMaker including versions of Lorem Ipsum.
42
+ EOL
43
+
44
+ Lol.puts lorem
45
+ ```
46
+
47
+ ## Development
48
+
49
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
50
+
51
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
52
+
53
+ ## Contributing
54
+
55
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lolruby.
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "lolruby"
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__)
@@ -0,0 +1,8 @@
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
@@ -0,0 +1,7 @@
1
+ all: build
2
+
3
+ build:
4
+ go get github.com/kris-nova/lolgopher
5
+ go build -buildmode=c-shared -o lol.so lol.go
6
+ install:
7
+ clean:
File without changes
@@ -0,0 +1,15 @@
1
+ package main
2
+
3
+ import (
4
+ "C"
5
+ lol "github.com/kris-nova/lolgopher"
6
+ )
7
+
8
+ //export puts
9
+ func puts(str *C.char) {
10
+ s := C.GoString(str)
11
+ lol.Println(s)
12
+ return
13
+ }
14
+
15
+ func main() {}
Binary file
@@ -0,0 +1,8 @@
1
+ require 'ffi'
2
+ require 'lolruby/version'
3
+
4
+ module Lol
5
+ extend FFI::Library
6
+ ffi_lib File.expand_path('../../ext/lolruby/lol.so', __FILE__)
7
+ attach_function :puts, [:string], :void
8
+ end
@@ -0,0 +1,3 @@
1
+ module Lol
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "lolruby/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "lolruby"
8
+ spec.version = Lol::VERSION
9
+ spec.authors = ["shotat"]
10
+ spec.email = ["shotat@users.noreply.github.com"]
11
+
12
+ spec.summary = %q{Write a short summary, because Rubygems requires one.}
13
+ spec.description = %q{Write a longer description or delete this line.}
14
+ spec.homepage = "https://github.com/shotat/lolruby"
15
+ spec.extensions = %w[ext/lolruby/extconf.rb]
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_dependency "ffi"
25
+ spec.add_development_dependency "bundler", "~> 1.15"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "rspec", "~> 3.0"
28
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lolruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - shotat
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-11-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ffi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.15'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.15'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ description: Write a longer description or delete this line.
70
+ email:
71
+ - shotat@users.noreply.github.com
72
+ executables: []
73
+ extensions:
74
+ - ext/lolruby/extconf.rb
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".rspec"
79
+ - ".travis.yml"
80
+ - Gemfile
81
+ - README.md
82
+ - Rakefile
83
+ - bin/console
84
+ - bin/setup
85
+ - ext/lolruby/Makefile
86
+ - ext/lolruby/extconf.rb
87
+ - ext/lolruby/lol.go
88
+ - img/1.png
89
+ - lib/lolruby.rb
90
+ - lib/lolruby/version.rb
91
+ - lolruby.gemspec
92
+ homepage: https://github.com/shotat/lolruby
93
+ licenses: []
94
+ metadata: {}
95
+ post_install_message:
96
+ rdoc_options: []
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ requirements: []
110
+ rubyforge_project:
111
+ rubygems_version: 2.6.11
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: Write a short summary, because Rubygems requires one.
115
+ test_files: []