sqlite_ext 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/sqlite_ext/version.rb +1 -1
- data/lib/sqlite_ext.rb +13 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e99ee0f6c66c7e55e973b02d7a9622f79b58da81
|
4
|
+
data.tar.gz: faede6051495e25fa791dcd9f8b9d121d52289d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61b01e63fa525cc1dde7f9734299fb7bd7b358620a3a2e32dadebf779a7cdb2ba66c255b0a7da2ed173a4547035ecc80fb5727ccb485046820fb5922fc858e73
|
7
|
+
data.tar.gz: f31a9220f5f51d89d6888c142d37ba37ebbed08c118f76ef5081fbd30eedc0a4f253b3864086d3db8cd22414445cdb77b2d3c0678c92682f621c34c3d5364df2
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
### 1.
|
1
|
+
### 1.4.0 - 2016-05-26
|
2
|
+
* Enhancements
|
3
|
+
* `SqliteExt.register_ruby_math` now also registers `pi`, `e`, `mod`,
|
4
|
+
and `power` functions.
|
5
|
+
|
6
|
+
### 1.3.0 - 2016-05-26
|
2
7
|
* Features
|
3
8
|
* Adds `SQLite3::Database.function_created?` to check whether a
|
4
9
|
function with a given name has been created on the target instance.
|
data/lib/sqlite_ext/version.rb
CHANGED
data/lib/sqlite_ext.rb
CHANGED
@@ -70,8 +70,9 @@ module SqliteExt
|
|
70
70
|
end
|
71
71
|
|
72
72
|
# Registers most of the public module methods of Ruby's
|
73
|
-
# `Math` module as well as `ceil
|
74
|
-
#
|
73
|
+
# `Math` module as well as `ceil`, `floor`, `mod`, and
|
74
|
+
# `power` based on `Float` instance methods to be used as
|
75
|
+
# functions in SQL code executed through subsequent new
|
75
76
|
# instances of `SQLite3::Database`.
|
76
77
|
#
|
77
78
|
# The `Math.frexp` method is omitted becuse it returns an
|
@@ -101,8 +102,16 @@ module SqliteExt
|
|
101
102
|
fn_methods.each do |m|
|
102
103
|
register_function m, Math.method(m)
|
103
104
|
end
|
104
|
-
|
105
|
-
|
105
|
+
register_function 'pi', ->(){ Math::PI }
|
106
|
+
register_function 'e', ->(){ Math::E }
|
107
|
+
[
|
108
|
+
[ :floor ],
|
109
|
+
[ :ceil ],
|
110
|
+
[ :modulo, :mod ],
|
111
|
+
[ :**, :power ]
|
112
|
+
].each do |(*args)|
|
113
|
+
m, fn = args.first, args.last
|
114
|
+
register_function fn, m.to_proc
|
106
115
|
end
|
107
116
|
self.ruby_math_is_registered = true
|
108
117
|
end
|