-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to add component meta #27
Ability to add component meta #27
Conversation
|
||
assert_instance_of Array, component.styleguide_stubs | ||
assert_equal expected_stub, component.styleguide_stubs.first | ||
end | ||
|
||
def test_component_stubs | ||
component = MountainView::Component.new('header') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
component_without_stub_file = | ||
MountainView::Component.new("social_media_icons") | ||
compoenet_with_stubs_but_incorrect_format = | ||
MountainView::Component.new('card') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
@@ -7,6 +7,7 @@ class ComponentGeneratorTest < Rails::Generators::TestCase | |||
setup :prepare_destination | |||
|
|||
test "Assert all files are properly created" do | |||
skip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GustavoCaso Why do we skip both tests in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jgnatch They are failing randomly, if you check the travis builds you'll see, also in development they fail randomly, or maybe I'm missing something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can always re-run them. I think it's preferable to have the tests as false negatives and re-run them than to skip them.
I tried figuring out why it randomly failed but wasn't successful. Any feedback is welcome on that!
end | ||
|
||
def stubs_correct_format? | ||
(styleguide_stubs.is_a?(Hash) && styleguide_stubs.key?(:stubs)) || styleguide_stubs.is_a?(Array) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [102/80]
@jgnatch @kitop I have update my code to support Really appreciated, thanks. |
@GustavoCaso Thanks!! Will give it a look tomorrow evening :) Thanks again!!! |
@kitop how we doing with this one ? |
@GustavoCaso having some really busy days, sorry for the delay!! |
@GustavoCaso Sorry for the late response! Everything looks great. def self.stub_example
File.read(File.expand_path("../example.yml", __FILE__))
end and related code that was changed in: a77f908. When I mentioned Ideally, going back to the original way it was done, but just changing |
@kitop Don't worry I can do it myself, I really like to help. So basically what you want is an |
I'd was thinking of that, going back to how the example was rendered (by just reading a file), but make that file a bit more flexible so we could add component name and make the help a bit more friendly :) More than happy to hear what you think about it! Sorry again about the miscommunication. |
@kitop I tried doing that, loading a file example with extension But what I did was added the name of the component to that file and display and example stubs so that the users knows how to proceed if they don't have stubs or the have invalid format. Still giving support for previous stubs as @kitop I'm open to suggestions, if you don't like this way. |
@GustavoCaso Ah, I see. Thanks for the screenshot :) I guess the Everything looks great! Thanks again for your collaboration. Will probably merge today. |
Hey @kitop what is the status with this one ? |
@GustavoCaso merged. Thanks for your patience! |
Congrats @GustavoCaso!! |
👏 👏 😀 |
Hi guys, do you realise this isn't yet in a tagged release so bundler isn't pulling in the changes? I got around it by pulling in the master branch directly from github:
I'm not sure if that's intentional, or just an oversight. |
@OddEssay totally an oversight! Just released v0.8.0 😄 Readme still has to be updated to reflect latest changes, but the code is in there! |
This pull request is related with the #24 issue.
This will let user to add meta information about the component, in their
#{component}.yml
file.I didn't know the best way of configuring this so I changed a liitle the structure of the
yml
file, now you need to havestubs
that would be an array of components.There could be some problems for supporting previous components, so I added a extra check on the display of the component, to check it follow the correct format
stubs_correct_format?
so that way if in the future we change the format the user will know. Also if the user have previous stubs it will show the correct format to him thanks to this methodstub_example
, it will show an example componentyml
file.I will wait for your feedback