Skip to content

Commit 7f4efcd

Browse files
committed
Merge remote-tracking branch 'upstream/master' into functions
Conflicts: symengine_version.txt
2 parents c8551ef + 3564da1 commit 7f4efcd

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

ext/symengine/symengine.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <symengine/cwrapper.h>
12
#include "ruby_basic.h"
23
#include "ruby_symbol.h"
34
#include "ruby_integer.h"
@@ -10,8 +11,16 @@
1011
// Ruby Bindings //
1112
///////////////////
1213

14+
VALUE msymengine_ascii_art(VALUE self) {
15+
char* str = ascii_art_str();
16+
VALUE ascii_art = rb_str_new_cstr(str);
17+
basic_str_free(str);
18+
return ascii_art;
19+
}
20+
1321
void Init_symengine() {
1422
m_symengine = rb_define_module("SymEngine");
23+
rb_define_singleton_method(m_symengine, "ascii_art", msymengine_ascii_art, 0);
1524

1625
//Basic class
1726
c_basic = rb_define_class_under(m_symengine, "Basic", rb_cObject);

lib/symengine.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
11
require 'symengine/symengine'
22
require 'symengine/iruby'
33
require 'symengine/basic'
4-
5-
module SymEngine
6-
def SymEngine.ascii_art
7-
puts "
8-
_____ _____ _
9-
| __|_ _ _____| __|___ ___|_|___ ___
10-
|__ | | | | __| | . | | | -_|
11-
|_____|_ |_|_|_|_____|_|_|_ |_|_|_|___|
12-
|___| |___| "
13-
end
14-
end

spec/symengine_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require 'spec_helper'
2+
3+
describe SymEngine do
4+
describe 'ascii_art' do
5+
it 'should return a non-zero length string' do
6+
assert SymEngine.ascii_art.length > 0
7+
end
8+
end
9+
end

symengine_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
b41eaa38906f357a52624ba8eaa5ccec4b82edd4
1+
e5852bf07ed6c9a344fea8da4cd5a11b803194e8
22

0 commit comments

Comments
 (0)