magic 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Jakub Kuźma
1
+ Copyright (c) 2010 Jakub Kuźma
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -6,10 +6,8 @@ Description goes here.
6
6
 
7
7
  * Fork the project.
8
8
  * Make your feature addition or bug fix.
9
- * Add tests for it. This is important so I don't break it in a
10
- future version unintentionally.
11
- * Commit, do not mess with rakefile, version, or history.
12
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
9
+ * Add tests for it. This is important so I don't break it in a future version unintentionally.
10
+ * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
13
11
  * Send me a pull request. Bonus points for topic branches.
14
12
 
15
13
  == Copyright
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/lib/magic.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  require "ffi"
2
2
 
3
+ ENV["DYLD_FALLBACK_LIBRARY_PATH"] ||= "/opt/local/lib" if FFI::Platform.mac?
4
+
3
5
  require "magic/errors"
4
- require "magic/library"
5
6
  require "magic/api"
6
7
  require "magic/constants"
7
8
  require "magic/database"
data/lib/magic/api.rb CHANGED
@@ -2,7 +2,7 @@ module Magic
2
2
  module Api
3
3
  extend FFI::Library
4
4
 
5
- ffi_lib Library.new.name
5
+ ffi_lib "magic.1"
6
6
 
7
7
  attach_function :magic_open, [:int], :pointer
8
8
  attach_function :magic_close, [:pointer], :void
data/lib/magic/errors.rb CHANGED
@@ -1,4 +1,3 @@
1
1
  module Magic
2
2
  class Exception < StandardError; end
3
- class UnsupportedPlatform < Exception; end
4
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Jakub Ku\xC5\xBAma"
@@ -53,7 +53,6 @@ files:
53
53
  - lib/magic/constants.rb
54
54
  - lib/magic/database.rb
55
55
  - lib/magic/errors.rb
56
- - lib/magic/library.rb
57
56
  - test/helper.rb
58
57
  - test/test_magic.rb
59
58
  has_rdoc: true
data/lib/magic/library.rb DELETED
@@ -1,22 +0,0 @@
1
- module Magic
2
- class Library
3
- def initialize
4
- name or raise UnsupportedPlatform, "platform #{platform} is unsupported"
5
- end
6
-
7
- def platform
8
- RUBY_PLATFORM.downcase
9
- end
10
-
11
- def name
12
- case platform
13
- when /darwin/
14
- "libmagic.1.dylib"
15
- when /linux|freebsd|netbsd|openbsd|dragonfly|solaris/
16
- "libmagic.so.1"
17
- when /win|mingw/
18
- "magic1.dll"
19
- end
20
- end
21
- end
22
- end