ffi_gen 1.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +1 -1
  2. data/lib/ffi_gen.rb +3 -1
  3. metadata +3 -3
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ffi_gen - A Generator for Ruby FFI bindings
1
+ ffi_gen - A generator for Ruby FFI bindings
2
2
  ===========================================
3
3
 
4
4
  *Author:* Richard Musiol
data/lib/ffi_gen.rb CHANGED
@@ -573,7 +573,7 @@ class FFIGen
573
573
  str.sub! /^_*/, '' # remove underscores at the beginning
574
574
  str.gsub! /__+/, '_' # replace multiple underscores by only one
575
575
  str.downcase!
576
- str.sub! /^\d/, '_\1' # fix illegal beginnings
576
+ str.sub! /^\d/, '_\0' # fix illegal beginnings
577
577
  str = "_#{str}" if avoid_keywords and RUBY_KEYWORDS.include? str
578
578
  str
579
579
  end
@@ -581,6 +581,8 @@ class FFIGen
581
581
  def to_ruby_camelcase(str)
582
582
  str = str.dup
583
583
  str.sub! /^(#{@prefixes.join('|')})/, '' # remove prefixes
584
+ str.gsub!(/(^|_)[a-z]/) { |match| match.upcase } # make word beginnings upcased
585
+ str.gsub! '_', '' # remove all underscores
584
586
  str
585
587
  end
586
588
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi_gen
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
16
- requirement: &20255460 !ruby/object:Gem::Requirement
16
+ requirement: &17288240 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 1.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *20255460
24
+ version_requirements: *17288240
25
25
  description: A generator for Ruby FFI bindings, directly from header files via LLVM's
26
26
  Clang compiler
27
27
  email: mail@richard-musiol.de