-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bunch of fixes in handling ruby exceptions and calling modules in YCP…
… namespace
- Loading branch information
1 parent
5e6aae3
commit 2ed5146
Showing
10 changed files
with
142 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
add_definitions(-DY2LOG=\"Ruby\") | ||
|
||
FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*/*.rb") | ||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ycp.rb DESTINATION ${RUBY_VENDORLIB_DIR} ) | ||
INSTALL(FILES ${files} DESTINATION ${RUBY_VENDORLIB_DIR}/ycp) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
UI::OpenDialog( `opt( `defaultsize ), `Label( "Hello, World!" ) ); | ||
UI::UserInput(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require "ycp" | ||
|
||
module YCP | ||
module CommonModule | ||
include Exportable | ||
|
||
publish :method => :method_a, :type => "string(integer,integer)" | ||
def self.method_a first, second | ||
(first+second).to_s | ||
end | ||
|
||
publish :variable => :name, :type => "string" | ||
self.name = "Cool name" | ||
|
||
publish :method => :formated_name, :type => "string()" | ||
def self.formated_name | ||
return exhibit+" Fancy Formated!!!" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,7 @@ | ||
// | ||
{ | ||
import "InRuby"; | ||
string result = tostring(InRuby::multiply_by_eight(10)); | ||
y2milestone("result: %1", result); | ||
result = tostring(InRuby::raising_code()); | ||
if (result==nil) | ||
{ | ||
result = tostring(InRuby::last_exception()); | ||
y2milestone("result: %1", result); | ||
if(result != "Wow exception!") | ||
return false; | ||
} | ||
else | ||
{ | ||
y2error("exception completely ignored result: %1",result); | ||
return false; | ||
} | ||
map h = tomap(InRuby::get_hash()); | ||
y2milestone("get hash: %1",h); | ||
if ( tostring(h["a"]:"") != "b" || tostring(h["b"]:"") != "c" ) | ||
{ | ||
y2error("map is not properly returned: %1",result); | ||
return false; | ||
} | ||
import "CamelCase"; | ||
result = tostring(CamelCase::inc(10)); | ||
y2milestone("result: %1", result); | ||
return true; | ||
import "CommonModule"; | ||
|
||
string res = CommonModule::method_a(5,6); | ||
y2milestone ("Should be 11 => %1", res); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters