Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ext/symengine/symengine.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <symengine/cwrapper.h>
#include "ruby_basic.h"
#include "ruby_symbol.h"
#include "ruby_integer.h"
Expand All @@ -9,8 +10,16 @@
// Ruby Bindings //
///////////////////

VALUE msymengine_ascii_art(VALUE self) {
char* str = ascii_art_str();
VALUE ascii_art = rb_str_new_cstr(str);
basic_str_free(str);
return ascii_art;
}

void Init_symengine() {
m_symengine = rb_define_module("SymEngine");
rb_define_singleton_method(m_symengine, "ascii_art", msymengine_ascii_art, 0);

//Basic class
c_basic = rb_define_class_under(m_symengine, "Basic", rb_cObject);
Expand Down
11 changes: 0 additions & 11 deletions lib/symengine.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
require 'symengine/symengine'
require 'symengine/iruby'
require 'symengine/basic'

module SymEngine
def SymEngine.ascii_art
puts "
_____ _____ _
| __|_ _ _____| __|___ ___|_|___ ___
|__ | | | | __| | . | | | -_|
|_____|_ |_|_|_|_____|_|_|_ |_|_|_|___|
|___| |___| "
end
end
9 changes: 9 additions & 0 deletions spec/symengine_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'spec_helper'

describe SymEngine do
describe 'ascii_art' do
it 'should return a non-zero length string' do
assert SymEngine.ascii_art.length > 0
end
end
end
2 changes: 1 addition & 1 deletion symengine_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f6f1c89bde0d12ba718a9aeddcdf630f36893756
668cf3a16f7c3a162727a8ffd6776e84dca78a41