alt_printf 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef60a8fd93c32deac84199e5e100931395b49b9ca9607b0f7bb2f85c33053336
4
- data.tar.gz: 3493d175317701758435c9df33f132929002ec4849e3947dfcbd61fa64adb14d
3
+ metadata.gz: f50fd84e833ac015b4f55845977226517d4a6bdf6eddbd3f11f9d02469d90cc6
4
+ data.tar.gz: 1529357cc8d3be38c484ca051ed9c8ce40ffbc42ae0688b4378d4938a0fc84d5
5
5
  SHA512:
6
- metadata.gz: 928750fe556edaedad637b9157fbd7c32e5c14e5c6c9b0ac63b36b81440ae9d8b95655506fcc5f2d645fdf1cc4965fff469f854bb4f749fdbcbc8dba975a28e3
7
- data.tar.gz: 4a5d4ef54fa8e96700c1c2ebb10c392d8668e2f67aed657ea771c47a5806e256769d1c1bc605f3c607b74b3a07e98daadbb189df9c6bc5b26a656784b5c2ea2a
6
+ metadata.gz: 105b0e3857ef953693eb2542d57f5f7d35d366cbb302d200e5f5eca78f56e9ed3b54eaa6ef20f58eabb02b5f1445698b418c3cc58f652b2d0b98f8a0b3fb35fb
7
+ data.tar.gz: 4a4a514ba52a28f799f9894f22b0523174b8215b014c6dbad34bece8e78f5f8dd43510fc95b1b55fafa9ef4f22fa895461fb08f6b8c5e51aac92a19dadf94ce9
@@ -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"]
@@ -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
  }
@@ -1,5 +1,6 @@
1
1
  #ifndef ALTPRINTF_H_
2
2
  #define ALTPRINTF_H_
3
+ #define ALTPRINTF_VERSION "0.2.2"
3
4
  #include "parsef.h"
4
5
  #include "fmt.h"
5
6
  #endif
@@ -1,4 +1,2 @@
1
- require_relative 'alt_printf/version'
2
1
  require_relative 'alt_printf/alt_printf'
3
-
4
- module AltPrintf end
2
+ require_relative 'alt_printf/version'
Binary file
@@ -1,3 +1,3 @@
1
1
  module AltPrintf
2
- VERSION = [0, 2, 1]
2
+ VERSION = [0, 2, 2]
3
3
  end
@@ -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.1
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
@@ -1,2 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
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
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require_relative 'extconf_helper'
4
- ExtconfHelper.setup
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require_relative 'extconf_helper'
4
- ExtconfHelper.setup('debug')
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require_relative 'extconf_helper'
4
- ExtconfHelper.setup('dev')