alt_printf 0.2.1 → 0.2.2
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 +4 -4
- data/alt_printf.gemspec +1 -1
- data/ext/alt_printf/alt_printf.c +7 -1
- data/ext/alt_printf/altprintf.h +1 -0
- data/lib/alt_printf.rb +1 -3
- data/lib/alt_printf/alt_printf.so +0 -0
- data/lib/alt_printf/version.rb +1 -1
- data/readme.md +16 -0
- metadata +3 -9
- data/Gemfile +0 -2
- data/README.md +0 -14
- data/Rakefile +0 -61
- data/ext/alt_printf/extconf.rb +0 -4
- data/ext/alt_printf/extconf_debug.rb +0 -4
- data/ext/alt_printf/extconf_dev.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f50fd84e833ac015b4f55845977226517d4a6bdf6eddbd3f11f9d02469d90cc6
|
4
|
+
data.tar.gz: 1529357cc8d3be38c484ca051ed9c8ce40ffbc42ae0688b4378d4938a0fc84d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 105b0e3857ef953693eb2542d57f5f7d35d366cbb302d200e5f5eca78f56e9ed3b54eaa6ef20f58eabb02b5f1445698b418c3cc58f652b2d0b98f8a0b3fb35fb
|
7
|
+
data.tar.gz: 4a4a514ba52a28f799f9894f22b0523174b8215b014c6dbad34bece8e78f5f8dd43510fc95b1b55fafa9ef4f22fa895461fb08f6b8c5e51aac92a19dadf94ce9
|
data/alt_printf.gemspec
CHANGED
@@ -11,7 +11,7 @@ AltPrintf::SPEC = Gem::Specification.new do |s|
|
|
11
11
|
s.homepage = 'https://github.com/annacrombie/altprintf/tree/master/gem'
|
12
12
|
s.license = 'MIT'
|
13
13
|
|
14
|
-
s.files = Dir['{**/*}']
|
14
|
+
s.files = Dir['{**/*}'] - ['Rakefile']
|
15
15
|
|
16
16
|
s.platform = Gem::Platform::RUBY
|
17
17
|
s.extensions = Dir["ext/**/extconf.rb"]
|
data/ext/alt_printf/alt_printf.c
CHANGED
@@ -238,10 +238,16 @@ VALUE rb_alt_printf_multi_pass(size_t argc, VALUE *argv, VALUE self) {
|
|
238
238
|
}
|
239
239
|
|
240
240
|
void Init_alt_printf() {
|
241
|
-
VALUE mod;
|
241
|
+
VALUE mod, ver;
|
242
|
+
size_t len;
|
242
243
|
|
243
244
|
enc = rb_enc_find("UTF-8");
|
244
245
|
mod = rb_define_module(MODNAME);
|
246
|
+
|
247
|
+
len = strlen(ALTPRINTF_VERSION);
|
248
|
+
ver = rb_external_str_new_with_enc(ALTPRINTF_VERSION, len, enc);
|
249
|
+
rb_define_const(mod, "LIB_VERSION", ver);
|
250
|
+
|
245
251
|
rb_define_module_function(mod, "fmt", rb_alt_printf_single_pass, -1);
|
246
252
|
rb_define_module_function(mod, "fmtm", rb_alt_printf_multi_pass, -1);
|
247
253
|
}
|
data/ext/alt_printf/altprintf.h
CHANGED
data/lib/alt_printf.rb
CHANGED
Binary file
|
data/lib/alt_printf/version.rb
CHANGED
data/readme.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# AltPrintf
|
2
|
+
|
3
|
+
[rubygems.org/gems/alt_printf](https://rubygems.org/gems/alt_printf)
|
4
|
+
|
5
|
+
AltPrintf is a gem that wraps `altprintf`.
|
6
|
+
|
7
|
+
It exposes the following module functions
|
8
|
+
|
9
|
+
+ `AltPrintf#fmt(format_string, *args, **kwargs)`
|
10
|
+
+ `AltPrintf#fmtm(passes, format_string, *args, **kwargs)`
|
11
|
+
|
12
|
+
In addition to the syntax of vanilla altprintf, the following additional
|
13
|
+
argument is accepted:
|
14
|
+
|
15
|
+
+ `<val>` - access the value of the given hash with key `val` rather than
|
16
|
+
try to read the next argument.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alt_printf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stone Tickle
|
@@ -41,21 +41,14 @@ dependencies:
|
|
41
41
|
description:
|
42
42
|
email: lattis@mochiro.moe
|
43
43
|
executables: []
|
44
|
-
extensions:
|
45
|
-
- ext/alt_printf/extconf.rb
|
44
|
+
extensions: []
|
46
45
|
extra_rdoc_files: []
|
47
46
|
files:
|
48
|
-
- Gemfile
|
49
|
-
- README.md
|
50
|
-
- Rakefile
|
51
47
|
- alt_printf.gemspec
|
52
48
|
- ext/alt_printf/alt_printf.c
|
53
49
|
- ext/alt_printf/altprintf.h
|
54
50
|
- ext/alt_printf/enums.h
|
55
51
|
- ext/alt_printf/extconf.h
|
56
|
-
- ext/alt_printf/extconf.rb
|
57
|
-
- ext/alt_printf/extconf_debug.rb
|
58
|
-
- ext/alt_printf/extconf_dev.rb
|
59
52
|
- ext/alt_printf/extconf_helper.rb
|
60
53
|
- ext/alt_printf/fmt.c
|
61
54
|
- ext/alt_printf/fmt.h
|
@@ -70,6 +63,7 @@ files:
|
|
70
63
|
- lib/alt_printf.rb
|
71
64
|
- lib/alt_printf/alt_printf.so
|
72
65
|
- lib/alt_printf/version.rb
|
66
|
+
- readme.md
|
73
67
|
homepage: https://github.com/annacrombie/altprintf/tree/master/gem
|
74
68
|
licenses:
|
75
69
|
- MIT
|
data/Gemfile
DELETED
data/README.md
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# AltPrintf
|
2
|
-
|
3
|
-
AltPrintf is a gem that wraps `altprintf`.
|
4
|
-
|
5
|
-
It exposes the following module functions
|
6
|
-
|
7
|
-
+ `#fmt(format_string, *args, **kwargs)`
|
8
|
-
+ `#fmtm(passes, format_string, *args, **kwargs)`
|
9
|
-
|
10
|
-
In addition to the syntax of vanilla altprintf, the following additional
|
11
|
-
argument is accepted:
|
12
|
-
|
13
|
-
+ `<val>` - access the value of the given hash with key `:"#{val}"` rather than
|
14
|
-
try to read the next argument.
|
data/Rakefile
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'rake/extensiontask'
|
2
|
-
require 'bundler/gem_tasks'
|
3
|
-
require 'securerandom'
|
4
|
-
require 'fileutils'
|
5
|
-
|
6
|
-
SRC_DIR = File.join(__dir__, '../src')
|
7
|
-
|
8
|
-
Rake::ExtensionTask.new('alt_printf') do |ext|
|
9
|
-
ext.lib_dir = 'lib/alt_printf'
|
10
|
-
ext.config_script =
|
11
|
-
case ENV['GEM_DEBUG']
|
12
|
-
when nil
|
13
|
-
'extconf_dev.rb'
|
14
|
-
else
|
15
|
-
'extconf_debug.rb'
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
desc 'copy necessary C files from ../src and build the resulting gem'
|
20
|
-
task :build_gem do
|
21
|
-
tmp_dir = "/tmp/alt_printf_#{SecureRandom.hex(8)}"
|
22
|
-
puts "cloning to #{tmp_dir}"
|
23
|
-
FileUtils.mkdir(tmp_dir)
|
24
|
-
|
25
|
-
Dir[
|
26
|
-
'Gemfile',
|
27
|
-
'README.md',
|
28
|
-
'Rakefile',
|
29
|
-
'alt_printf.gemspec',
|
30
|
-
'{ext,lib}/**/*'
|
31
|
-
].each do |f|
|
32
|
-
next if File.directory?(f)
|
33
|
-
|
34
|
-
dir = File.join(tmp_dir, File.dirname(f))
|
35
|
-
FileUtils.mkdir_p(dir)
|
36
|
-
FileUtils.cp(f, File.join(dir, File.basename(f)))
|
37
|
-
end
|
38
|
-
|
39
|
-
FileUtils.cp_r(
|
40
|
-
%w[altprintf fmt fmte parsef strbuf enums log syntax].map do |w|
|
41
|
-
%w[h c].map { |e| File.join(SRC_DIR, "#{w}.#{e}") }
|
42
|
-
.select { |f| File.exist?(f) }
|
43
|
-
end.flatten,
|
44
|
-
File.join(tmp_dir, 'ext/alt_printf/')
|
45
|
-
)
|
46
|
-
|
47
|
-
FileUtils.cd(tmp_dir)
|
48
|
-
|
49
|
-
sh "rake build"
|
50
|
-
|
51
|
-
FileUtils.cp(Dir['pkg/*'], File.join(__dir__, 'pkg'))
|
52
|
-
FileUtils.cd(__dir__)
|
53
|
-
FileUtils.rm_rf(tmp_dir)
|
54
|
-
end
|
55
|
-
|
56
|
-
desc 'uses build_gem and pushes the resulting gem'
|
57
|
-
task publish: :build_gem do
|
58
|
-
load File.join(__dir__, 'alt_printf.gemspec')
|
59
|
-
|
60
|
-
sh "gem push pkg/#{AltPrintf::SPEC.name}-#{AltPrintf::SPEC.version}.gem"
|
61
|
-
end
|
data/ext/alt_printf/extconf.rb
DELETED